Skip to content

Commit

Permalink
cleaning up the angular templates and snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpapa committed Aug 16, 2014
1 parent 973831f commit fad42e4
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

angular
.module('app')
.controller('$safeitemname$', ['$scope', $safeitemname$]);
.controller('$safeitemname$', $safeitemname$);

$safeitemname$.$inject = ['$scope'];

function $safeitemname$($scope) {
$scope.title = '$safeitemname$';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

angular
.module('app')
.controller('$safeitemname$', ['$location', $safeitemname$]);
.controller('$safeitemname$', $safeitemname$);

$safeitemname$.$inject = ['$location'];

function $safeitemname$($location) {
/* jshint validthis:true */
var vm = this;
vm.title = '$safeitemname$';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

angular
.module('app')
.directive('$safeitemname$', ['$window', $safeitemname$]);
.directive('$safeitemname$', $safeitemname$);

$safeitemname$.$inject = ['$window'];

function $safeitemname$ ($window) {
// Usage:
Expand All @@ -12,7 +14,7 @@
//
var directive = {
link: link,
restrict: 'A'
restrict: 'EA'
};
return directive;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

angular
.module('app')
.factory('$safeitemname$', ['$http', $safeitemname$]);
.factory('$safeitemname$', $safeitemname$);

$safeitemname$.$inject = ['$http'];

function $safeitemname$($http) {
var service = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@
(function () {
'use strict';

var $id$ = '$controller$';
angular.module('$module$').controller($id$,
['$dependency$', $controller$]);
angular
.module('$module$')
.controller('$controller$', $controller$);

$controller$.$inject = ['$dependency$'];

function $controller$($dependency$) {
/* jshint validthis:true */
var vm = this;

vm.$member1$ = $member1$;

function $member1$() {
}
vm.title = '';

//#region Internal Methods
activate();

//#endregion
function activate() { }
}
})();
]]>
Expand Down
10 changes: 7 additions & 3 deletions TemplatePack/Snippets/JavaScript/SideWaffle/ng.directive.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,24 @@
</Declarations>
<Code Language="JavaScript">
<![CDATA[
$module$.directive('$directive$', ['$dependency$', function ($dependency$) {
$module$.directive('$directive$', $directive$);

$directive.$inject = ['$dependency$'];

function $directive$($dependency$) {
// Usage:
//
// Creates:
//
var directive = {
link: link,
restrict: 'A'
restrict: 'EA'
};
return directive;

function link(scope, element, attrs) {
}
}]);
});
]]>
</Code>
</Snippet>
Expand Down
12 changes: 6 additions & 6 deletions TemplatePack/Snippets/JavaScript/SideWaffle/ng.service.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@
<![CDATA[
(function () {
'use strict';
var $id$ = '$service$';
angular.module('$module$').factory($id$, ['$dependency$', $service$]);

angular
.module('$module$')
.factory('$service$', $service$);

$service$.$inject = ['$dependency$'];

function $service$($dependency$) {
var service = {
Expand All @@ -53,10 +57,6 @@
function $member1$() {

}

//#region Internal Methods

//#endregion
}
})();
]]>
Expand Down

0 comments on commit fad42e4

Please sign in to comment.