我有我的角度应用程序使用路由和两个视图。从视图2到视图1的角度链接不刷新页面
当第二个观点,我只是试图重新添加一个链接以查看1,即“返回首页”
我尝试了以下内容和它的作品ofcourse,但它的作用就像一个正常的href和刷新页
<a href="/">Back to Search</a>
如何添加一个没有完整页面刷新但只是改变视图的链接?
编辑添加了路由配置
app.config(['$routeProvider','$locationProvider', function($routeProvider,$locationProvider){
$routeProvider
.when('/',{
templateUrl: '/views/main.html',
controller : 'SearchCtrl'
})
.when('/result',{
templateUrl: '/views/result.html',
controller : 'resultCtrl'
})
.otherwise({
redirectTo : '/'
});
}]);
什么是写你的网页在你的路线供应商/供应商的状态(“/”)? – 2014-12-02 11:17:03
你需要处理这种情况,以及在你的路线提供者。当选项 – Kop4lyf 2014-12-02 11:17:46
看起来像我必须像这样添加“" to stop the full refresh when im back in the root..is this normal ? – StevieB 2014-12-02 11:37:01