Skip to content

Instantly share code, notes, and snippets.

@CallumVass
Created April 11, 2014 07:37
Show Gist options
  • Save CallumVass/10447200 to your computer and use it in GitHub Desktop.
Save CallumVass/10447200 to your computer and use it in GitHub Desktop.
Yeoman Angular Generator
app.js:
'use strict';
angular.module('yeomanTestApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute'
])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.otherwise({
redirectTo: '/'
});
});
main.js:
'use strict';
angular.module('yeomanTestApp')
.controller('MainCtrl', function ($scope) {
$scope.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
'Karma'
];
});
app.js:
(function () {
'use strict';
angular.module('yeomanTestApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute'
])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.otherwise({
redirectTo: '/'
});
}]);
})();
main.js:
(function () {
'use strict';
angular.module('yeomanTestApp')
.controller('MainCtrl', ['$scope', function ($scope) {
$scope.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
'Karma'
];
}]);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment