Last active
August 29, 2015 14:07
-
-
Save taly2808/83d19aa063bf87d4bac2 to your computer and use it in GitHub Desktop.
This file contains 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
angular.module('spaApp', ['ngRoute']) | |
.config(['$routeProvider', | |
function($routeProvider) { | |
$routeProvider | |
.when('/home', { | |
templateUrl: 'pages/home.html', | |
controller: 'HomeController' | |
}) | |
.when('/about', { | |
templateUrl: 'pages/about.html', | |
controller: 'AboutController' | |
}) | |
.when('/contact', { | |
templateUrl: 'pages/contact.html', | |
controller: 'ContactController' | |
}) | |
.otherwise({ | |
redirectTo: '/home' | |
}); | |
} | |
]) | |
.controller('HomeController', function($scope) { | |
$scope.flash = 'Hello world! I am Tweedy bird.'; | |
$scope.img = 'http://img2.wikia.nocookie.net/__cb20121120221843/scratchpad/images/thumb/5/54/Tweety.gif/180px-Tweety.gif'; | |
}) | |
.controller('AboutController', function($scope) { | |
$scope.flash = 'This is about page, hihi!'; | |
}) | |
.controller('ContactController', function($scope) { | |
$scope.flash = 'Contact with us at here!'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment