IB坐席来电号码屏蔽学习同事Angular的ng-view
在一个jsp页面,有它自己的controller,但是
其中有用到模板!
angular.module里要加上路由也就是ngRoute
然后配置源
myModule.config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when('/test', {
templateUrl: 'html/public/customer/viewIBCustomer.html',
controller: 'viewIBCustomerCtrl'
});
}]);
从以上代码看出controller已经写了,所以在页面里不用写了。
/test这个名字起有点差,让别人不好找!!
原来的jsp页面要加一个div里面有ng-view指令
跳转到viewIBCustomer.html后,不用引别的js!!
直接展示就ok!!
这里在跳转过来的时候他用的是$location.path('test');
这里的test就是上面when里的