feat(offline compiler): a replacement for tsc that compiles templates
see #7483.
This commit is contained in:
1
tools/compiler_cli/test/src/a/multiple_components.html
Normal file
1
tools/compiler_cli/test/src/a/multiple_components.html
Normal file
@ -0,0 +1 @@
|
||||
<div></div>
|
21
tools/compiler_cli/test/src/a/multiple_components.ts
Normal file
21
tools/compiler_cli/test/src/a/multiple_components.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import {Component} from 'angular2/core';
|
||||
|
||||
@Component({
|
||||
selector: 'my-comp',
|
||||
template: '<div></div>',
|
||||
})
|
||||
export class MyComp {
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'next-comp',
|
||||
templateUrl: './multiple_components.html',
|
||||
})
|
||||
export class NextComp {
|
||||
}
|
||||
|
||||
// Verify that exceptions from DirectiveResolver don't propagate
|
||||
export function NotADirective(c: any): void {}
|
||||
@NotADirective
|
||||
export class HasCustomDecorator {
|
||||
}
|
2
tools/compiler_cli/test/src/basic.html
Normal file
2
tools/compiler_cli/test/src/basic.html
Normal file
@ -0,0 +1,2 @@
|
||||
<div>{{ctxProp}}</div>
|
||||
<form><input type="button" [(ngModel)]="ctxProp"/></form>
|
14
tools/compiler_cli/test/src/basic.ts
Normal file
14
tools/compiler_cli/test/src/basic.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import {Component, Injectable} from 'angular2/core';
|
||||
import {FORM_DIRECTIVES} from 'angular2/common';
|
||||
import {MyComp} from './a/multiple_components';
|
||||
|
||||
@Component({
|
||||
selector: 'basic',
|
||||
templateUrl: './basic.html',
|
||||
directives: [MyComp, FORM_DIRECTIVES],
|
||||
})
|
||||
@Injectable()
|
||||
export class Basic {
|
||||
ctxProp: string;
|
||||
constructor() { this.ctxProp = 'initial value'; }
|
||||
}
|
8
tools/compiler_cli/test/src/bootstrap.ts
Normal file
8
tools/compiler_cli/test/src/bootstrap.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import {coreBootstrap, ReflectiveInjector} from 'angular2/core';
|
||||
import {browserPlatform, BROWSER_APP_PROVIDERS} from 'angular2/platform/browser';
|
||||
import {BasicNgFactory} from './basic.ngfactory';
|
||||
import {Basic} from './basic';
|
||||
|
||||
const appInjector =
|
||||
ReflectiveInjector.resolveAndCreate(BROWSER_APP_PROVIDERS, browserPlatform().injector);
|
||||
coreBootstrap(appInjector, BasicNgFactory);
|
2
tools/compiler_cli/test/src/dep.d.ts
vendored
Normal file
2
tools/compiler_cli/test/src/dep.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
// Verify we don't try to extract metadata for .d.ts files
|
||||
export declare var a: string;
|
Reference in New Issue
Block a user