Mais conteúdo relacionado
Semelhante a AngularJS Routing (20)
AngularJS Routing
- 6. var myApp = angular.module('myApp', ['ngRoute']);
myApp.config(function ($routeProvider) {
$routeProvider
.when('/view2/:viewId',
{
Routing Object
templateUrl: 'View2.html',
controller : 'viewCtrl'
})
.otherwise({ redirectTo: '/' });
});
- 9. var myApp = angular.module('myApp', ['ngRoute']);
Routing Object
myApp.config(function ($routeProvider) {
$routeProvider
Controller or controllerAs
.when('/view2/:viewId',
Template or TemplateUrl
{
templateUrl:
Resolve
'View2.html',
controller : 'viewCtrl'
})
RedirectTo
});
.otherwise({ redirectTo: '/' });
[reloadOnSearch=true]
[caseInsensitiveMatch=false]