Last active
October 18, 2019 14:14
-
-
Save tonyjoanes/1bee6f06717458f75d4a93c1f4490a58 to your computer and use it in GitHub Desktop.
AngularJS Controllers using $inject
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
(function () { | |
'use strict'; | |
angular | |
.module('app') | |
.controller('MyController', MyController); | |
MyController.$inject = ['dependencyOne', 'dependecyTwo']; | |
function MyController( | |
dependecyOne, | |
dependecyTwo) { | |
var vm = this; | |
vm.data = { | |
greetingMessage : 'Hello I am some data from the controller', | |
clickHandler : dependecyOne.click | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment