Home  >  Article  >  Web Front-end  >  Detailed explanation of path issues in angular

Detailed explanation of path issues in angular

零下一度
零下一度Original
2017-07-02 09:42:371690browse

When we write a project, we will encounter a situation where the startup page is transferred to the guide page, and the guide page is transferred to the home page.

If we are not careful when writing this kind of thing using the angular framework, we will If you encounter a problem,

, for example, you can’t find the picture on the guide page, etc.

So how do we solve this problem?

First of all, we need to make it clear that we are using the angular framework, so we should use the framework in angular to solve this problem,

instead of following the original idea of ​​using the step-by-step path jump.

Let’s take a look,

1. Jump from the startup page to the boot page

app.controller("zeroController",function ($timeout) {var timer = $timeout(function(){
        location.href="#/enter";
        //注意跳转路径
    },1000);
});

2. Jump from the boot page to the home page

//引导页app.controller("enterController",function ($scope) {
//Touchmove()手指在屏幕上移动的时候触发的事件,当手指在屏幕上移动的时候要阻止浏览器的document.addEventListener("touchmove",function (e) {var ev=e||e.widows;
        ev.preventDefault();
    },{passive:false});
    })(Zepto);
    $scope.enter=function () {
        location.href = "index.html#/reg";
        //问题的错误注意点
    }
});

The above is the detailed content of Detailed explanation of path issues in angular. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn