Skip to content

Commit baad1d3

Browse files
committed
chore(template): clean up templates
1 parent 2c9a371 commit baad1d3

File tree

15 files changed

+36
-72
lines changed

15 files changed

+36
-72
lines changed

addon/ng2/blueprints/class/files/__path__/__name__.spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
/* tslint:disable:no-unused-variable */
22

3-
import {
4-
beforeEach, beforeEachProviders,
5-
describe, xdescribe,
6-
expect, it, xit,
7-
async, inject
8-
} from '@angular/core/testing';
3+
import { addProviders, async, inject } from '@angular/core/testing';
94
import {<%= classifiedModuleName %>} from './<%= fileName %>';
105

116
describe('<%= classifiedModuleName %>', () => {

addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@
22

33
import { By } from '@angular/platform-browser';
44
import { DebugElement } from '@angular/core';
5-
6-
import {
7-
beforeEach, beforeEachProviders,
8-
describe, xdescribe,
9-
expect, it, xit,
10-
async, inject
11-
} from '@angular/core/testing';
12-
5+
import { addProviders, async, inject } from '@angular/core/testing';
136
import { <%= classifiedModuleName %>Component } from './<%= dasherizedModuleName %>.component';
147

158
describe('Component: <%= classifiedModuleName %>', () => {

addon/ng2/blueprints/component/files/__path__/__name__.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Component, OnInit } from '@angular/core';
1414
})
1515
export class <%= classifiedModuleName %>Component implements OnInit {
1616

17-
constructor() {}
17+
constructor() { }
1818

1919
ngOnInit() {
2020
}

addon/ng2/blueprints/directive/files/__path__/__name__.directive.spec.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
/* tslint:disable:no-unused-variable */
22

3-
import {
4-
beforeEach, beforeEachProviders,
5-
describe, xdescribe,
6-
expect, it, xit,
7-
async, inject
8-
} from '@angular/core/testing';
3+
import { addProviders, async, inject } from '@angular/core/testing';
94
import { <%= classifiedModuleName %> } from './<%= dasherizedModuleName %>.directive';
105

11-
describe('<%= classifiedModuleName %> Directive', () => {
6+
describe('Directive: <%= classifiedModuleName %>', () => {
127
it('should create an instance', () => {
138
let directive = new <%= classifiedModuleName %>();
149
expect(directive).toBeTruthy();

addon/ng2/blueprints/directive/files/__path__/__name__.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import { Directive } from '@angular/core';
55
})
66
export class <%= classifiedModuleName %> {
77

8-
constructor() {}
8+
constructor() { }
99

1010
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export enum <%= classifiedModuleName %> {
2-
32
}
Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
/* tslint:disable:no-unused-variable */
22

3-
import {
4-
beforeEach, beforeEachProviders,
5-
describe, xdescribe,
6-
expect, it, xit,
7-
async, inject
8-
} from '@angular/core/testing';
3+
import { addProviders, async, inject } from '@angular/core/testing';
94
import { AppComponent } from './app.component';
105

11-
beforeEachProviders(() => [AppComponent]);
12-
136
describe('App: <%= jsComponentName %>', () => {
7+
beforeEach(() => {
8+
addProviders([AppComponent]);
9+
});
10+
1411
it('should create the app',
15-
inject([AppComponent], (app: AppComponent) => {
16-
expect(app).toBeTruthy();
17-
}));
12+
inject([AppComponent], (app: AppComponent) => {
13+
expect(app).toBeTruthy();
14+
}));
1815

1916
it('should have as title \'app works!\'',
20-
inject([AppComponent], (app: AppComponent) => {
21-
expect(app.title).toEqual('app works!');
22-
}));
17+
inject([AppComponent], (app: AppComponent) => {
18+
expect(app.title).toEqual('app works!');
19+
}));
2320
});

addon/ng2/blueprints/ng2/files/__path__/index.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
</head>
3131
<body>
3232
<<%= prefix %>-root>Loading...</<%= prefix %>-root>
33-
3433
<% if (isMobile) { %>
35-
3634
{{#if environment.production}}
3735
<script src="/app-concat.js" async></script>
3836
{{else}}
@@ -45,9 +43,7 @@
4543
}).catch(console.error.bind(console));
4644
</script>
4745
{{/if}}
48-
4946
<% } else { %>
50-
5147
{{#each scripts.polyfills}}
5248
<script src="{{.}}"></script>
5349
{{/each}}
@@ -56,8 +52,6 @@
5652
System.import('main');
5753
}).catch(console.error.bind(console));
5854
</script>
59-
6055
<% } %>
61-
6256
</body>
6357
</html>

addon/ng2/blueprints/ng2/files/__path__/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ if (environment.production) {
88
}
99

1010
bootstrap(AppComponent<% if(isMobile) { %>, [ APP_SHELL_RUNTIME_PROVIDERS ]<% } %>);
11-

addon/ng2/blueprints/ng2/files/config/environment.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ module.exports = function(environment) {
1010
locationType: 'auto'
1111
};
1212
};
13-

addon/ng2/blueprints/ng2/files/config/karma-test-shim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ System.import('system-config.js').then(function() {
5353
allSpecFiles.map(function (moduleName) {
5454
return System.import(moduleName);
5555
}));
56-
}).then(__karma__.start, __karma__.error);
56+
}).then(__karma__.start, __karma__.error);

addon/ng2/blueprints/ng2/files/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
},
1414
"private": true,
1515
"dependencies": {
16-
"@angular/common": "2.0.0-rc.3",
17-
"@angular/compiler": "2.0.0-rc.3",
18-
"@angular/core": "2.0.0-rc.3",
16+
"@angular/common": "2.0.0-rc.4",
17+
"@angular/compiler": "2.0.0-rc.4",
18+
"@angular/core": "2.0.0-rc.4",
1919
"@angular/forms": "0.2.0",
20-
"@angular/http": "2.0.0-rc.3",
21-
"@angular/platform-browser": "2.0.0-rc.3",
22-
"@angular/platform-browser-dynamic": "2.0.0-rc.3",
20+
"@angular/http": "2.0.0-rc.4",
21+
"@angular/platform-browser": "2.0.0-rc.4",
22+
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
2323
"@angular/router": "3.0.0-beta.2",
2424
"es6-shim": "0.35.1",
2525
"reflect-metadata": "0.1.3",
@@ -28,7 +28,7 @@
2828
"zone.js": "0.6.12"
2929
},
3030
"devDependencies": {<% if(isMobile) { %>
31-
"@angular/platform-server": "2.0.0-rc.3",
31+
"@angular/platform-server": "2.0.0-rc.4",
3232
"@angular/service-worker": "0.2.0",
3333
"@angular/app-shell": "0.0.0",
3434
"angular2-broccoli-prerender": "0.11.0",

addon/ng2/blueprints/pipe/files/__path__/__name__.pipe.spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
/* tslint:disable:no-unused-variable */
22

3-
import {
4-
beforeEach, beforeEachProviders,
5-
describe, xdescribe,
6-
expect, it, xit,
7-
async, inject
8-
} from '@angular/core/testing';
3+
import { addProviders, async, inject } from '@angular/core/testing';
94
import { <%= classifiedModuleName %>Pipe } from './<%= dasherizedModuleName %>.pipe';
105

116
describe('Pipe: <%= classifiedModuleName %>', () => {
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
/* tslint:disable:no-unused-variable */
22

3-
import {
4-
beforeEach, beforeEachProviders,
5-
describe, xdescribe,
6-
expect, it, xit,
7-
async, inject
8-
} from '@angular/core/testing';
3+
import { addProviders, async, inject } from '@angular/core/testing';
94
import { <%= classifiedModuleName %>Service } from './<%= dasherizedModuleName %>.service';
105

11-
describe('<%= classifiedModuleName %> Service', () => {
12-
beforeEachProviders(() => [<%= classifiedModuleName %>Service]);
6+
describe('Service: <%= classifiedModuleName %>', () => {
7+
beforeEach(() => {
8+
addProviders([<%= classifiedModuleName %>Service]);
9+
});
1310

1411
it('should ...',
15-
inject([<%= classifiedModuleName %>Service], (service: <%= classifiedModuleName %>Service) => {
16-
expect(service).toBeTruthy();
17-
}));
12+
inject([<%= classifiedModuleName %>Service],
13+
(service: <%= classifiedModuleName %>Service) => {
14+
expect(service).toBeTruthy();
15+
}));
1816
});

addon/ng2/blueprints/service/files/__path__/__name__.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import { Injectable } from '@angular/core';
33
@Injectable()
44
export class <%= classifiedModuleName %>Service {
55

6-
constructor() {}
6+
constructor() { }
77

88
}

0 commit comments

Comments
 (0)