Skip to content

Instantly share code, notes, and snippets.

@tonyjoanes
Last active October 18, 2019 14:14
Show Gist options
  • Save tonyjoanes/1bee6f06717458f75d4a93c1f4490a58 to your computer and use it in GitHub Desktop.
Save tonyjoanes/1bee6f06717458f75d4a93c1f4490a58 to your computer and use it in GitHub Desktop.
AngularJS Controllers using $inject
(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