Skip to content

Commit 41d341a

Browse files
Jed Maoprotomouse
Jed Mao
authored and
protomouse
committed
Fix indentation, use lambdas
1 parent 4d8464b commit 41d341a

File tree

12 files changed

+85
-85
lines changed

12 files changed

+85
-85
lines changed

templates/typescript/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
'use strict';
88

99
angular.module('<%= scriptAppName %>', [<%= angularModules %>])<% if (ngRoute) { %>
10-
.config(function ($routeProvider:ng.route.IRouteProvider) {
10+
.config(($routeProvider:ng.route.IRouteProvider) => {
1111
$routeProvider
1212
.when('/', {
1313
templateUrl: 'views/main.html',

templates/typescript/controller.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
'use strict';
44

55
module <%= scriptAppName %> {
6-
export interface I<%= classedName %>Scope extends ng.IScope {
7-
awesomeThings: any[];
8-
}
9-
10-
export class <%= classedName %>Ctrl {
6+
export interface I<%= classedName %>Scope extends ng.IScope {
7+
awesomeThings: any[];
8+
}
9+
10+
export class <%= classedName %>Ctrl {
1111

12-
constructor (private $scope:I<%= classedName %>Scope) {
13-
$scope.awesomeThings = [
14-
'HTML5 Boilerplate',
15-
'AngularJS',
16-
'Karma'
17-
];
18-
}
12+
constructor (private $scope:I<%= classedName %>Scope) {
13+
$scope.awesomeThings = [
14+
'HTML5 Boilerplate',
15+
'AngularJS',
16+
'Karma'
17+
];
1918
}
19+
}
2020
}
2121

2222
angular.module('<%= scriptAppName %>')

templates/typescript/decorator.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
'use strict';
44

55
module <%= scriptAppName %>{
6-
export function <%= cameledName %>DecoratorProvider($provide:ng.auto.IProvideService):void {
7-
//decorate <%= cameledName %>
8-
$provide.decorator('<%= cameledName %>', <%= cameledName %>Decorator);
9-
}
6+
export function <%= cameledName %>DecoratorProvider($provide:ng.auto.IProvideService):void {
7+
//decorate <%= cameledName %>
8+
$provide.decorator('<%= cameledName %>', <%= cameledName %>Decorator);
9+
}
1010

11-
export function <%= cameledName %>Decorator($delegate) {
12-
// decorate the $delegate
13-
return $delegate;
14-
}
11+
export function <%= cameledName %>Decorator($delegate) {
12+
// decorate the $delegate
13+
return $delegate;
14+
}
1515
}
1616

1717
angular.module('<%= scriptAppName %>')
18-
.config(<%= scriptAppName %>.<%= cameledName %>DecoratorProvider);
18+
.config(<%= scriptAppName %>.<%= cameledName %>DecoratorProvider);

templates/typescript/directive.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
module <%= scriptAppName %> {
66

7-
export class <%= classedName %> implements ng.IDirective {
8-
template = '<div></div>';
9-
restrict = 'E';
10-
link = function (scope, element: JQuery, attrs: ng.IAttributes):void {
11-
element.text('this is the <%= cameledName %> directive');
12-
}
13-
}
14-
15-
export function <%= cameledName %>Factory() {
16-
return new <%= scriptAppName %>.<%= classedName %>();
17-
}
18-
7+
export class <%= classedName %> implements ng.IDirective {
8+
template = '<div></div>';
9+
restrict = 'E';
10+
link = (scope, element: JQuery, attrs: ng.IAttributes):void => {
11+
element.text('this is the <%= cameledName %> directive');
12+
}
13+
}
14+
15+
export function <%= cameledName %>Factory() {
16+
return new <%= scriptAppName %>.<%= classedName %>();
17+
}
18+
1919
}
2020

2121
angular.module('<%= scriptAppName %>')

templates/typescript/filter.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
'use strict';
44

55
module <%= scriptAppName %> {
6-
export function <%= cameledName %>FilterFactory():Function {
7-
return <%= cameledName %>Filter;
8-
}
9-
10-
function <%= cameledName %>Filter(input, param) {
11-
//usage {{"text" | <%= cameledName %>: "suffix"}}
12-
//returns '<%= cameledName %> filter: text suffix'
13-
return '<%= cameledName %> filter: ' + input + (param ? ' ' + param: '');
14-
}
6+
export function <%= cameledName %>FilterFactory():Function {
7+
return <%= cameledName %>Filter;
8+
}
9+
10+
function <%= cameledName %>Filter(input, param) {
11+
//usage {{"text" | <%= cameledName %>: "suffix"}}
12+
//returns '<%= cameledName %> filter: text suffix'
13+
return '<%= cameledName %> filter: ' + input + (param ? ' ' + param: '');
14+
}
1515
}
1616

1717
angular.module('<%= scriptAppName %>')

templates/typescript/service/factory.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
'use strict';
44

55
module <%= scriptAppName %> {
6-
export function <%= cameledName %>Factory() {
7-
return new <%= classedName %>(42);
8-
}
9-
export class <%= classedName %> {
6+
export function <%= cameledName %>Factory() {
7+
return new <%= classedName %>(42);
8+
}
109

11-
constructor (private meaningOfLife) {
12-
}
10+
export class <%= classedName %> {
1311

14-
someMethod(){
15-
return this.meaningOfLife
16-
}
17-
}
12+
constructor (private meaningOfLife) {
13+
}
14+
15+
someMethod() {
16+
return this.meaningOfLife;
17+
}
18+
}
1819
}
1920

2021
angular.module('<%= scriptAppName %>')

templates/typescript/service/provider.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44

55
module <%= scriptAppName %> {
66

7-
var salutation:string;
8-
9-
export class Greeter {
10-
greet = () => salutation;
11-
}
12-
13-
14-
export class <%= classedName %>Provider {
15-
$get = () => new Greeter();
16-
17-
// Public API for configuration
18-
setSalutation = (s:string) => salutation = s;
19-
}
7+
var salutation:string;
8+
9+
export class Greeter {
10+
greet = () => salutation;
11+
}
12+
13+
export class <%= classedName %>Provider {
14+
$get = () => new Greeter();
15+
16+
// Public API for configuration
17+
setSalutation = (s:string) => salutation = s;
18+
}
2019

2120
}
2221

templates/typescript/service/service.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
'use strict';
44

55
module <%= scriptAppName %> {
6-
export class <%= classedName %> {
7-
awesomeThings:any[] = [
8-
'HTML5 Boilerplate',
9-
'AngularJS',
10-
'Karma'
11-
];
12-
}
6+
export class <%= classedName %> {
7+
awesomeThings:any[] = [
8+
'HTML5 Boilerplate',
9+
'AngularJS',
10+
'Karma'
11+
];
12+
}
1313
}
1414

1515
angular.module('<%= scriptAppName %>')

templates/typescript/spec/controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
'use strict';
88

9-
describe('Controller: <%= classedName %>Ctrl', function () {
9+
describe('Controller: <%= classedName %>Ctrl', () => {
1010

1111
// load the controller's module
1212
beforeEach(module('<%= scriptAppName %>'));
@@ -15,14 +15,14 @@ describe('Controller: <%= classedName %>Ctrl', function () {
1515
scope;
1616

1717
// Initialize the controller and a mock scope
18-
beforeEach(inject(function ($controller, $rootScope) {
18+
beforeEach(inject(($controller, $rootScope) => {
1919
scope = $rootScope.$new();
2020
<%= classedName %>Ctrl = $controller('<%= classedName %>Ctrl', {
2121
$scope: scope
2222
});
2323
}));
2424

25-
it('should attach a list of awesomeThings to the scope', function () {
25+
it('should attach a list of awesomeThings to the scope', () => {
2626
expect(scope.awesomeThings.length).toBe(3);
2727
});
2828
});

templates/typescript/spec/directive.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66

77
'use strict';
88

9-
describe('Directive: <%= cameledName %>', function () {
9+
describe('Directive: <%= cameledName %>', () => {
1010

1111
// load the directive's module
1212
beforeEach(module('<%= scriptAppName %>'));
1313

1414
var element,
1515
scope;
1616

17-
beforeEach(inject(function ($rootScope) {
17+
beforeEach(inject(($rootScope) => {
1818
scope = $rootScope.$new();
1919
}));
2020

21-
it('should make hidden element visible', inject(function ($compile) {
21+
it('should make hidden element visible', inject(($compile) => {
2222
element = angular.element('<<%= _.dasherize(name) %>></<%= _.dasherize(name) %>>');
2323
element = $compile(element)(scope);
2424
expect(element.text()).toBe('this is the <%= cameledName %> directive');

templates/typescript/spec/filter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66

77
'use strict';
88

9-
describe('Filter: <%= cameledName %>', function () {
9+
describe('Filter: <%= cameledName %>', () => {
1010

1111
// load the filter's module
1212
beforeEach(module('<%= scriptAppName %>'));
1313

1414
// initialize a new instance of the filter before each test
1515
var <%= cameledName %>;
16-
beforeEach(inject(function ($filter) {
16+
beforeEach(inject($filter => {
1717
<%= cameledName %> = $filter('<%= cameledName %>');
1818
}));
1919

20-
it('should return the input prefixed with "<%= cameledName %> filter:"', function () {
20+
it('should return the input prefixed with "<%= cameledName %> filter:"', () => {
2121
var text = 'angularjs';
2222
expect(<%= cameledName %>(text)).toBe('<%= cameledName %> filter: ' + text);
2323
});

templates/typescript/spec/service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66

77
'use strict';
88

9-
describe('Service: <%= cameledName %>', function () {
9+
describe('Service: <%= cameledName %>', () => {
1010

1111
// load the service's module
1212
beforeEach(module('<%= scriptAppName %>'));
1313

1414
// instantiate service
1515
var <%= cameledName %>;
16-
beforeEach(inject(function (_<%= cameledName %>_) {
16+
beforeEach(inject(_<%= cameledName %>_ => {
1717
<%= cameledName %> = _<%= cameledName %>_;
1818
}));
1919

20-
it('should do something', function () {
20+
it('should do something', () => {
2121
expect(!!<%= cameledName %>).toBe(true);
2222
});
2323

0 commit comments

Comments
 (0)