Last active
September 19, 2017 15:26
[AngularJS Templates] #javascript #angular
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 (angular) { | |
'use strict'; | |
angular | |
.module('app') | |
.constant('MY_VAL', { | |
foo: 'bar' | |
}); | |
})(window.angular); |
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 (angular) { | |
'use strict'; | |
angular | |
.module('app') | |
.controller('MyController', MyController); | |
MyController.$inject = ['$scope']; | |
function MyController ($scope) { | |
$scope.title = 'MyController'; | |
activate(); | |
function activate() { } | |
} | |
})(window.angular); |
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 (angular) { | |
'use strict'; | |
angular | |
.module('app') | |
.controller('MyController', MyController); | |
MyController.$inject = ['$location']; | |
function MyController ($location) { | |
var vm = this; | |
vm.title = 'MyController'; | |
activate(); | |
function activate() { } | |
} | |
})(window.angular); |
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(angular) { | |
'use strict'; | |
angular | |
.module('app') | |
.directive('myDirective', myDirective); | |
myDirective.$inject = ['$window']; | |
function myDirective ($window) { | |
var directive = { | |
link: link, | |
restrict: 'EA' | |
}; | |
return directive; | |
function link(scope, element, attrs) { | |
} | |
} | |
})(window.angular); |
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 (angular) { | |
'use strict'; | |
angular | |
.module('app') | |
.factory('myFactory', myFactory); | |
myFactory.$inject = ['$http']; | |
function myFactory ($http) { | |
var service = { | |
getData: getData | |
}; | |
return service; | |
function getData() { } | |
} | |
})(window.angular); |
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 (angular) { | |
'use strict'; | |
angular | |
.module('app') | |
.filter('myFilter', myFilter); | |
function myFilter () { | |
return function(input) { | |
return input ? '\u2713' : '\u2718'; | |
}; | |
} | |
})(window.angular); |
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 (angular) { | |
'use strict'; | |
angular.module('$safeitemname$', [ | |
// Angular modules | |
'ngAnimate', | |
'ngRoute' | |
// Custom modules | |
// 3rd Party Modules | |
]); | |
})(window.angular); |
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 (angular) { | |
'use strict'; | |
angular | |
.module('app') | |
.service('MyService', MyService); | |
MyService.$inject = ['$http']; | |
function MyService ($http) { | |
this.getData = getData; | |
function getData() { } | |
} | |
})(window.angular); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment