模块路由:
原文链接:https://www.f2er.com/angularjs/146122.htmlvar switchModule = angular.module('switchModule',[]); switchModule.config(['$routeProvider',function($routeProvider) { $routeProvider. when('/build-content',{templateUrl: 'build-content.html',controller: BuildInfoController}); }]);
控制器:
function BuildInfoController($http,$scope){ alert("hello"); }
Html:
<html ng-app="switchModule"> ... <body> <ul> <li><a href="#build-content"/></a></li> </ul> <div class="ng-view"></div> </body> ...