Created
April 30, 2014 02:11
-
-
Save AlphaGit/09af98de7ac11cf7a1fe to your computer and use it in GitHub Desktop.
Example controller in AngularJS, declared separatedly
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 MyController = function($scope, ApiService) { | |
$scope.awesomeThings = ['everything']; // everything is awesome | |
$scope.randomStuff = null; | |
ApiService.getStuff('random').then(function(retrievedStuff) { | |
$scope.randomStuff = retrievedStuff; | |
}); | |
}; | |
angular.module('MyApp').controller('MyController', MyController); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment