我们在写项目时会遇到启动页调到引导页,引导页再调到首页,
那我们在用angular框架写这种东西的时候如果我们不细心的话就会遇到问题,
比如说找不到引导页的图片等等。
那我们怎么解决这个问题呢?
首先我们要明确,我们使用的angular框架所以我们应该使用angular中的框架来解决这个问题,
而不是还是按照原来的思想按部就班的使用路径跳转。
下面我们就来看一下,
1、启动页跳到引导页
app.controller(zerocontroller,function ($timeout) {var timer = $timeout(function(){
location.href=#/enter;
//注意跳转路径
},1000);
});
2、引导页跳到首页
//引导页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;
//问题的错误注意点
}
});
以上就是angular中关于路径问题的详解的详细内容。