refactor(compiler): rename /compiler_cli to /compiler-cli
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<div></div>
|
||||
@@ -0,0 +1,27 @@
|
||||
import {Component} from '@angular/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 {
|
||||
}
|
||||
|
||||
// Verify that custom decorators have metadata collected, eg Ionic
|
||||
export function Page(c: any): (f: Function) => void {return c;}
|
||||
|
||||
@Page({template: 'Ionic template'})
|
||||
export class AnIonicPage {}
|
||||
@@ -0,0 +1,3 @@
|
||||
@import './shared.css';
|
||||
|
||||
.green { color: green }
|
||||
@@ -0,0 +1,4 @@
|
||||
<div [attr.array]="[0]" [attr.map]="{a:1}">{{ctxProp}}</div>
|
||||
<form><input type="button" [(ngModel)]="ctxProp"/></form>
|
||||
<my-comp *ngIf="ctxBool"></my-comp>
|
||||
<div *ngFor="let x of ctxArr" [attr.value]="x"></div>
|
||||
@@ -0,0 +1,17 @@
|
||||
import {Component, Inject} from '@angular/core';
|
||||
import {FORM_DIRECTIVES, NgIf, NgFor} from '@angular/common';
|
||||
import {MyComp} from './a/multiple_components';
|
||||
|
||||
@Component({
|
||||
selector: 'basic',
|
||||
templateUrl: './basic.html',
|
||||
styles: ['.red { color: red }'],
|
||||
styleUrls: ['./basic.css'],
|
||||
directives: [MyComp, FORM_DIRECTIVES, NgIf, NgFor]
|
||||
})
|
||||
export class Basic {
|
||||
ctxProp: string;
|
||||
ctxBool: boolean;
|
||||
ctxArr: any[] = [];
|
||||
constructor() { this.ctxProp = 'initialValue'; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import {coreBootstrap, ReflectiveInjector} from '@angular/core';
|
||||
import {browserPlatform, BROWSER_APP_PROVIDERS} from '@angular/platform-browser';
|
||||
import {BasicNgFactory} from './basic.ngfactory';
|
||||
import {Basic} from './basic';
|
||||
|
||||
const appInjector =
|
||||
ReflectiveInjector.resolveAndCreate(BROWSER_APP_PROVIDERS, browserPlatform().injector);
|
||||
coreBootstrap(BasicNgFactory, appInjector);
|
||||
@@ -0,0 +1,2 @@
|
||||
// Verify we don't try to extract metadata for .d.ts files
|
||||
export declare var a: string;
|
||||
@@ -0,0 +1,29 @@
|
||||
import {Component, Inject, OpaqueToken} from '@angular/core';
|
||||
import {NgIf} from '@angular/common';
|
||||
|
||||
export const SOME_OPAQUE_TOKEN = new OpaqueToken('opaqueToken');
|
||||
|
||||
@Component({
|
||||
selector: 'comp-providers',
|
||||
template: '',
|
||||
providers: [
|
||||
{provide: 'strToken', useValue: 'strValue'},
|
||||
{provide: SOME_OPAQUE_TOKEN, useValue: 10},
|
||||
{provide: 'reference', useValue: NgIf},
|
||||
{provide: 'complexToken', useValue: {a: 1, b: ['test', SOME_OPAQUE_TOKEN]}},
|
||||
]
|
||||
})
|
||||
export class CompWithProviders {
|
||||
constructor(@Inject('strToken') public ctxProp: string) {}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'cmp-reference',
|
||||
template: `
|
||||
<input #a>{{a.value}}
|
||||
<div *ngIf="true">{{a.value}}</div>
|
||||
`,
|
||||
directives: [NgIf]
|
||||
})
|
||||
export class CompWithReferences {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'comp-with-proj',
|
||||
template: '<ng-content></ng-content>'
|
||||
})
|
||||
export class CompWithProjection {
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'main',
|
||||
template: '<comp-with-proj><span greeting="Hello world!"></span></comp-with-proj>',
|
||||
directives: [CompWithProjection]
|
||||
})
|
||||
export class MainComp {}
|
||||
@@ -0,0 +1 @@
|
||||
.blue { color: blue }
|
||||
Reference in New Issue
Block a user