homework/ng1/app/routes.js

25 lines
648 B
JavaScript
Raw Normal View History

2017-04-30 20:02:47 +03:00
(function () {
'use strict';
angular.module('app').config(RouteConfig);
RouteConfig.$inject = ["$routeProvider"]
function RouteConfig($routeProvider) {
$routeProvider.when('/search', {
templateUrl : 'app/search.html',
controller : 'SearchCtrl',
controllerAs : 'vm'
}).when("/new", {
templateUrl: "app/edit.html",
controller: "EditCtrl",
controllerAs: "vm"
}).when("/edit/:id", {
templateUrl: "app/edit.html",
controller: "EditCtrl",
controllerAs: "vm"
}).otherwise("/search")
}
})();