Skip to content
This repository was archived by the owner on Oct 12, 2021. It is now read-only.

Commit 1e3f995

Browse files
mgechevalxhub
authored andcommitted
chore(AppShell): update to rc.5 (#96)
1 parent ffea4ac commit 1e3f995

17 files changed

+55
-71
lines changed

app-shell/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
},
1717
"private": true,
1818
"dependencies": {
19-
"@angular/common": "~2.0.0-rc.0",
20-
"@angular/compiler": "~2.0.0-rc.0",
21-
"@angular/core": "~2.0.0-rc.0",
22-
"@angular/platform-browser": "~2.0.0-rc.0",
23-
"@angular/platform-browser-dynamic": "~2.0.0-rc.0",
19+
"@angular/common": "~2.0.0-rc.5",
20+
"@angular/compiler": "~2.0.0-rc.5",
21+
"@angular/core": "~2.0.0-rc.5",
22+
"@angular/platform-browser": "~2.0.0-rc.5",
23+
"@angular/platform-browser-dynamic": "~2.0.0-rc.5",
2424
"es6-shim": "^0.35.0",
2525
"reflect-metadata": "0.1.3",
2626
"rxjs": "5.0.0-beta.6",

app-shell/src/app/index.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
import { Type } from '@angular/core';
1+
import { Type, NgModule, ModuleWithProviders } from '@angular/core';
22
import { ShellRender } from './shell-render.directive';
33
import { ShellNoRender } from './shell-no-render.directive';
4+
import { APP_SHELL_RUNTIME_PROVIDERS, APP_SHELL_BUILD_PROVIDERS } from './is-prerender.service';
45

56
export * from './is-prerender.service';
6-
export * from './shell-no-render.directive';
7-
export * from './shell-render.directive';
87
export * from './shell-parser';
98

109
export const APP_SHELL_DIRECTIVES: Type[] = [
1110
ShellRender,
1211
ShellNoRender
1312
];
13+
14+
@NgModule({
15+
exports: APP_SHELL_DIRECTIVES,
16+
declarations: APP_SHELL_DIRECTIVES
17+
})
18+
export class AppShellModule {
19+
static forRoot(): ModuleWithProviders {
20+
return {
21+
ngModule: AppShellModule,
22+
providers: [APP_SHELL_RUNTIME_PROVIDERS, APP_SHELL_BUILD_PROVIDERS]
23+
};
24+
}
25+
}
26+
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import {
2-
beforeEachProviders,
3-
it,
4-
describe,
5-
expect,
2+
addProviders,
63
inject
74
} from '@angular/core/testing';
85
import {
@@ -13,7 +10,9 @@ import {
1310

1411
describe('IsPrerender Service', () => {
1512
describe('prerender', () => {
16-
beforeEachProviders(() => [APP_SHELL_BUILD_PROVIDERS]);
13+
beforeEach(() => {
14+
addProviders([APP_SHELL_BUILD_PROVIDERS]);
15+
});
1716

1817
it('should be true at build time',
1918
inject([IS_PRERENDER], (service: boolean) => {
@@ -23,14 +22,15 @@ describe('IsPrerender Service', () => {
2322

2423

2524
describe('runtime', () => {
26-
beforeEachProviders(() => [APP_SHELL_RUNTIME_PROVIDERS]);
25+
beforeEach(() => {
26+
addProviders([APP_SHELL_RUNTIME_PROVIDERS]);
27+
});
2728

2829
it('should be false at runtime',
2930
inject([IS_PRERENDER], (service: boolean) => {
3031
expect(service).toBeFalsy();
3132
}));
3233
});
3334

34-
35-
3635
});
36+

app-shell/src/app/is-prerender.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {OpaqueToken, provide, Provider} from '@angular/core';
1+
import { OpaqueToken, provide, Provider } from '@angular/core';
22

33
export const IS_PRERENDER = new OpaqueToken('IsPrerender');
44

app-shell/src/app/shell-no-render.directive.spec.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
import {
2+
ComponentFixture,
3+
TestComponentBuilder
4+
} from '@angular/core/testing';
5+
16
import {
27
async,
3-
beforeEachProviders,
4-
describe,
5-
expect,
6-
it,
7-
inject
8+
inject,
9+
addProviders
810
} from '@angular/core/testing';
9-
import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
1011
import { provide, Component } from '@angular/core';
1112
import { ShellNoRender } from './shell-no-render.directive';
1213
import {
@@ -23,7 +24,9 @@ class TestComponent {}
2324

2425
describe('ShellNoRender Directive', () => {
2526
describe('prerender', () => {
26-
beforeEachProviders((): any[] => [APP_SHELL_BUILD_PROVIDERS]);
27+
beforeEach(() => {
28+
addProviders([APP_SHELL_BUILD_PROVIDERS]);
29+
});
2730

2831
it('should NOT render the element', async(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => {
2932
return tcb.createAsync(TestComponent).then((fixture: ComponentFixture<TestComponent>) => {
@@ -36,7 +39,9 @@ describe('ShellNoRender Directive', () => {
3639

3740

3841
describe('runtime', () => {
39-
beforeEachProviders((): any[] => [APP_SHELL_RUNTIME_PROVIDERS]);
42+
beforeEach(() => {
43+
addProviders([APP_SHELL_RUNTIME_PROVIDERS]);
44+
});
4045

4146
it('should render the element', async(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => {
4247
return tcb.createAsync(TestComponent).then((fixture: ComponentFixture<TestComponent>) => {

app-shell/src/app/shell-no-render.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Directive, Inject, OnInit, ViewContainerRef, TemplateRef } from '@angular/core';
22

3-
import {IS_PRERENDER} from './is-prerender.service';
3+
import { IS_PRERENDER } from './is-prerender.service';
44

55
@Directive({selector: '[shellNoRender]'})
66
export class ShellNoRender implements OnInit {

app-shell/src/app/shell-parser/node-matcher/css-node-matcher.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import {
2-
beforeEach,
3-
it,
4-
describe,
5-
expect,
62
inject
73
} from '@angular/core/testing';
84
import { ASTNode } from '../ast';

app-shell/src/app/shell-parser/node-matcher/css-selector/css-selector.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import {
2-
beforeEachProviders,
3-
it,
4-
describe,
5-
expect,
62
inject
73
} from '@angular/core/testing';
84
import { CssSelector } from './css-selector';

app-shell/src/app/shell-parser/node-visitor/resource-inline/inline-style-resource-inline-visitor.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import {
2-
beforeEach,
3-
it,
4-
describe,
5-
expect,
62
inject
73
} from '@angular/core/testing';
84

app-shell/src/app/shell-parser/node-visitor/resource-inline/stylesheet-resource-inline-visitor.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import {
2-
beforeEach,
3-
it,
4-
describe,
5-
expect,
62
inject
73
} from '@angular/core/testing';
84

0 commit comments

Comments
 (0)