Skip to content

Instantly share code, notes, and snippets.

@qetr1ck-op
Last active October 21, 2015 11:11
Show Gist options
  • Save qetr1ck-op/01721016841fc0760acd to your computer and use it in GitHub Desktop.
Save qetr1ck-op/01721016841fc0760acd to your computer and use it in GitHub Desktop.
app.controller('MainCtrl', ['$scope', '$timeout', function($scope, $timeout){
$timeout(function() {
console.log($scope);
});
}]);
//another best bractice approach with $inject
app.controller('MainCtrl', mainCtrl);
mainCtrl.$inject = ['$scope', '$timeout'];
function mainCtrl($scope, $timeout) {
$timeout(function() {
console.log($scope);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment