Created
November 1, 2012 23:49
-
-
Save nsanta/3997645 to your computer and use it in GitHub Desktop.
angular timeline blog post gists
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
app = angular.module(‘AwesomeApp’, [‘ngResource’]). | |
.config [‘$routeProvider’, ($route) → | |
$route.when(‘/sessions’, { | |
controller: ‘SessionCtrl’, # replace the controller function by the controller name | |
templateUrl: ‘/app/templates/sessions/login.html’ | |
}) |
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
Session is a resource | |
@SessionCtrl = ($scope, $location, Session) → | |
$scope.login = → | |
Session.save $scope.session , (response) → | |
$location.path “/dashboard” |
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
#app is the variable that contains the module “AwesomeApp” | |
app.controller ‘SessionCtrl’, ($scope, $location, Session) → | |
$scope.login = → | |
Session.save $scope.session , (response) → | |
$location.path “/dashboard” |
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
app = angular.module(‘AwesomeApp’, [‘ngResource’]). | |
.config [‘$routeProvider’, ($route) → | |
$route.when(‘/sessions’, { | |
controller: SessionCtrl, | |
templateUrl: ‘/app/templates/sessions/login.html’ | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment