Skip to content

Instantly share code, notes, and snippets.

@chrisjlee
Last active January 13, 2016 19:20
Show Gist options
  • Save chrisjlee/fdf68fe09505e211bc4f to your computer and use it in GitHub Desktop.
Save chrisjlee/fdf68fe09505e211bc4f to your computer and use it in GitHub Desktop.
Example angular inject es5 format.
(function (ng) {
"use strict";
function MyController($scope) {
// Use Controller As syntax
// https://github.com/johnpapa/angular-styleguide#style-y032
var vm = this;
console.log('MyController', vm);
}
// Manually Inject Deps.
// https://github.com/johnpapa/angular-styleguide#style-y091
MyController.$inject = ['$scope'];
ng.module('app.myController', [])
.controller('myController', MyController);
})(angular || window.angular || {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment