Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Moved 'use strict'; to a functional scope inside js templates. #1127

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions templates/javascript/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* @ngdoc overview
* @name <%= scriptAppName %>
Expand All @@ -11,6 +9,8 @@
angular
.module('<%= scriptAppName %>', [<%= angularModules %>])<% if (ngRoute) { %>
.config(function ($routeProvider) {
'use strict';

$routeProvider
.when('/', {
templateUrl: 'views/main.html',
Expand Down
4 changes: 2 additions & 2 deletions templates/javascript/controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* @ngdoc function
* @name <%= scriptAppName %>.controller:<%= classedName %>Ctrl
Expand All @@ -9,6 +7,8 @@
*/
angular.module('<%= scriptAppName %>')
.controller('<%= classedName %>Ctrl', function () {
'use strict';

this.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
Expand Down
4 changes: 2 additions & 2 deletions templates/javascript/decorator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* @ngdoc function
* @name <%= scriptAppName %>.decorator:<%= classedName %>
Expand All @@ -9,6 +7,8 @@
*/
angular.module('<%= scriptAppName %>')
.config(function ($provide) {
'use strict';

$provide.decorator('<%= cameledName %>', function ($delegate) {
// decorate the $delegate
return $delegate;
Expand Down
4 changes: 2 additions & 2 deletions templates/javascript/directive.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* @ngdoc directive
* @name <%= scriptAppName %>.directive:<%= cameledName %>
Expand All @@ -8,6 +6,8 @@
*/
angular.module('<%= scriptAppName %>')
.directive('<%= cameledName %>', function () {
'use strict';

return {
template: '<div></div>',
restrict: 'E',
Expand Down
4 changes: 2 additions & 2 deletions templates/javascript/filter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* @ngdoc filter
* @name <%= scriptAppName %>.filter:<%= cameledName %>
Expand All @@ -10,6 +8,8 @@
*/
angular.module('<%= scriptAppName %>')
.filter('<%= cameledName %>', function () {
'use strict';

return function (input) {
return '<%= cameledName %> filter: ' + input;
};
Expand Down
4 changes: 2 additions & 2 deletions templates/javascript/service/factory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* @ngdoc service
* @name <%= scriptAppName %>.<%= cameledName %>
Expand All @@ -9,6 +7,8 @@
*/
angular.module('<%= scriptAppName %>')
.factory('<%= cameledName %>', function () {
'use strict';

// Service logic
// ...

Expand Down
3 changes: 1 addition & 2 deletions templates/javascript/service/provider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* @ngdoc service
* @name <%= scriptAppName %>.<%= cameledName %>
Expand All @@ -9,6 +7,7 @@
*/
angular.module('<%= scriptAppName %>')
.provider('<%= cameledName %>', function () {
'use strict';

// Private variables
var salutation = 'Hello';
Expand Down
4 changes: 2 additions & 2 deletions templates/javascript/service/service.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* @ngdoc service
* @name <%= scriptAppName %>.<%= cameledName %>
Expand All @@ -9,5 +7,7 @@
*/
angular.module('<%= scriptAppName %>')
.service('<%= cameledName %>', function () {
'use strict';

// AngularJS will instantiate a singleton by calling "new" on this function
});
3 changes: 1 addition & 2 deletions templates/javascript/spec/controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

describe('Controller: <%= classedName %>Ctrl', function () {
'use strict';

// load the controller's module
beforeEach(module('<%= scriptAppName %>'));
Expand Down
3 changes: 1 addition & 2 deletions templates/javascript/spec/directive.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

describe('Directive: <%= cameledName %>', function () {
'use strict';

// load the directive's module
beforeEach(module('<%= scriptAppName %>'));
Expand Down
3 changes: 1 addition & 2 deletions templates/javascript/spec/filter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

describe('Filter: <%= cameledName %>', function () {
'use strict';

// load the filter's module
beforeEach(module('<%= scriptAppName %>'));
Expand Down
3 changes: 1 addition & 2 deletions templates/javascript/spec/provider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

describe('Service: <%= cameledName %>', function () {
'use strict';

// instantiate service
var <%= cameledName %>,
Expand Down
3 changes: 1 addition & 2 deletions templates/javascript/spec/service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

describe('Service: <%= cameledName %>', function () {
'use strict';

// load the service's module
beforeEach(module('<%= scriptAppName %>'));
Expand Down