标签:
/** * mainApp module */var mainApp = angular.module(‘mainApp‘, [ ‘ngRoute‘, ‘ngResource‘ ]);mainApp.config([ ‘$routeProvider‘, function($routeProvider) { $routeProvider.when(‘/add.do‘, { templateUrl : ‘insurance_add.html‘, controller : ‘InsuranceAddController‘ }); $routeProvider.when(‘/list.do‘, { templateUrl : ‘insurance_list.html‘, controller : ‘InsuranceListController‘ }); $routeProvider.otherwise({ redirectTo : ‘/list.do‘ });} ]);/** * Controller */mainApp.controller(‘InsuranceAddController‘, [‘$scope‘, ‘$location‘, function($scope, $location) { $scope.gotoList = function() { $location.path(‘/list.do‘); }; }]);/** * Controller */mainApp.controller(‘InsuranceListController‘, [‘$scope‘, ‘$location‘, function($scope, $location) { $scope.gotoAdd = function() { $location.path(‘/add.do‘); }; }]);标签:
原文地址:http://www.cnblogs.com/JSWBK/p/5591588.html