8000 chore(app): rename *AppComponent to just AppComponent (#1042) · Madd/angular-cli@901bad0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 901bad0

Browse files
committed
chore(app): rename *AppComponent to just AppComponent (angular#1042)
1 parent f8f8179 commit 901bad0

File tree

9 files changed

+33
-35
lines changed

9 files changed

+33
-35
lines changed

addon/ng2/blueprints/mobile/files/__path__/main-app-shell.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
im 10000 port { provide } from '@angular/core';
22
import { APP_BASE_HREF } from '@angular/common';
33
import { APP_SHELL_BUILD_PROVIDERS } from '@angular/app-shell';
4-
import { <%= jsComponentName %>AppComponent } from './app/';
4+
import { AppComponent } from './app/';
55
import {
66
REQUEST_URL,
77
ORIGIN_URL
@@ -10,7 +10,7 @@ import {
1010
export const options = {
1111
directives: [
1212
// The component that will become the main App Shell
13-
<%= jsComponentName %>AppComponent
13+
AppComponent
1414
],
1515
platformProviders: [
1616
APP_SHELL_BUILD_PROVIDERS,

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

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {
2+
beforeEachProviders,
3+
describe,
4+
expect,
5+
it,
6+
inject
7+
} from '@angular/core/testing';
8+
import { AppComponent } from './app.component';
9+
10+
beforeEachProviders(() => [AppComponent]);
11+
12+
describe('App: <%= jsComponentName %>', () => {
13+
it('should create the app',
14+
inject([AppComponent], (app: AppComponent) => {
15+
expect(app).toBeTruthy();
16+
}));
17+
18+
it('should have as title \'app works!\'',
19+
inject([AppComponent], (app: AppComponent) => {
20+
expect(app.title).toEqual('app works!');
21+
}));
22+
});

addon/ng2/blueprints/ng2/files/__path__/app/__name__.component.ts renamed to addon/ng2/blueprints/ng2/files/__path__/app/app.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import { APP_SHELL_DIRECTIVES } from '@angular/app-shell';<% } %>
33

44
@Component({
55
moduleId: module.id,
6-
selector: '<%= htmlComponentName %>-app',
6+
selector: '<%= prefix %>-root',
77
<% if (isMobile) { %>template: `
88
<h1>
99
{{title}}
1010
</h1>
1111
`,
1212
styles: [],
13-
directives: [APP_SHELL_DIRECTIVES]<% } else { %>templateUrl: '<%= htmlComponentName %>.component.html',
14-
styleUrls: ['<%= dasherizedModuleName %>.component.css']<% } %>
13+
directives: [APP_SHELL_DIRECTIVES]<% } else { %>templateUrl: 'app.component.html',
14+
styleUrls: ['app.component.css']<% } %>
1515
})
16-
export class <%= jsComponentName %>AppComponent {
17-
title = '<%= htmlComponentName %> works!';
16+
export class AppComponent {
17+
title = 'app works!';
1818
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from './environment';
2-
export * from './<%= htmlComponentName %>.component';
2+
export * from './app.component';

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<% } %>
3030
</head>
3131
<body>
32-
<<%= htmlComponentName %>-app>Loading...</<%= htmlComponentName %>-app>
32+
<<%= prefix %>-root>Loading...</<%= prefix %>-root>
3333

3434
<% if (isMobile) { %>
3535

@@ -59,7 +59,5 @@
5959

6060
<% } %>
6161

62-
63-
6462
</body>
6563
</html>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { bootstrap } from '@angular/platform-browser-dynamic';
22
import { enableProdMode } from '@angular/core';
3-
import { <%= jsComponentName %>AppComponent, environment } from './app/';<% if(isMobile) { %>
3+
import { AppComponent, environment } from './app/';<% if(isMobile) { %>
44
import { APP_SHELL_RUNTIME_PROVIDERS } from '@angular/app-shell';<% } %>
55

66
if (environment.production) {
77
enableProdMode();
88
}
99

10-
bootstrap(<%= jsComponentName %>AppComponent<% if(isMobile) { %>, [ APP_SHELL_RUNTIME_PROVIDERS ]<% } %>);
10+
bootstrap(AppComponent<% if(isMobile) { %>, [ APP_SHELL_RUNTIME_PROVIDERS ]<% } %>);
1111

0 commit comments

Comments
 (0)
0