Last active
December 16, 2015 19:49
-
-
Save fraserxu/5487373 to your computer and use it in GitHub Desktop.
定义路由及Controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var module = angular.module('basicsite', | |
['ngResource']). | |
config(['$routeProvider', function ($routeProvider) { | |
$routeProvider. | |
when('/', | |
{templateUrl: '/js/views/main.html', controller: 'MainCtrl'}). | |
when('/sports', | |
{templateUrl: '/js/views/sports.html', controller: 'SportsCtrl'}). | |
when('/players', | |
{templateUrl: '/js/views/players.html', controller: 'PlayersCtrl'}). | |
otherwise({redirectTo: '/'}); | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment