chore: remove moduleId from examples (#3362)
* chore: remove moduleId from examples * add support for testing and plunkers * delete component-relative cookbook * latest touches * ward teaks and travis fixes * fix typo in style-guide
This commit is contained in:
parent
a841380f1d
commit
e6741efd8f
|
@ -86,6 +86,7 @@ var _excludeMatchers = _excludePatterns.map(function(excludePattern){
|
|||
var _exampleBoilerplateFiles = [
|
||||
'src/styles.css',
|
||||
'src/systemjs.config.js',
|
||||
'src/systemjs-angular-loader.js',
|
||||
'src/tsconfig.json',
|
||||
'bs-config.json',
|
||||
'bs-config.e2e.json',
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# _boilerplate files
|
||||
!_boilerplate/*
|
||||
*/*/src/styles.css
|
||||
*/*/src/systemjs-angular-loader.js
|
||||
*/*/src/systemjs.config.js
|
||||
*/*/src/tsconfig.json
|
||||
*/*/bs-config.e2e.json
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
var templateUrlRegex = /templateUrl\s*:(\s*['"`](.*?)['"`]\s*)/gm;
|
||||
var stylesRegex = /styleUrls *:(\s*\[[^\]]*?\])/g;
|
||||
var stringRegex = /(['`"])((?:[^\\]\\\1|.)*?)\1/g;
|
||||
|
||||
module.exports.translate = function(load){
|
||||
|
||||
var url = new URL(load.address);
|
||||
|
||||
var basePathParts = url.pathname.split('/');
|
||||
|
||||
if (url.href.indexOf('plnkr') != -1) {
|
||||
basePathParts.shift();
|
||||
basePathParts.shift();
|
||||
}
|
||||
|
||||
basePathParts.pop();
|
||||
var basePath = basePathParts.join('/');
|
||||
load.source = load.source
|
||||
.replace(templateUrlRegex, function(match, quote, url){
|
||||
let resolvedUrl = url;
|
||||
|
||||
if (url.startsWith('.')) {
|
||||
resolvedUrl = basePath + url.substr(1);
|
||||
}
|
||||
|
||||
return `templateUrl: '${resolvedUrl}'`;
|
||||
})
|
||||
.replace(stylesRegex, function(match, relativeUrls) {
|
||||
var urls = [];
|
||||
|
||||
while ((match = stringRegex.exec(relativeUrls)) !== null) {
|
||||
if (match[2].startsWith('.')) {
|
||||
urls.push(`'${basePath.substr(1)}${match[2].substr(1)}'`);
|
||||
} else {
|
||||
urls.push(`'${match[2]}'`);
|
||||
}
|
||||
}
|
||||
|
||||
return "styleUrls: [" + urls.join(', ') + "]";
|
||||
});
|
||||
|
||||
return load;
|
||||
};
|
|
@ -11,7 +11,7 @@
|
|||
// map tells the System loader where to look for things
|
||||
map: {
|
||||
// our app is within the app folder
|
||||
app: 'app',
|
||||
'app': 'app',
|
||||
|
||||
// angular bundles
|
||||
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
|
||||
|
@ -32,7 +32,12 @@
|
|||
packages: {
|
||||
app: {
|
||||
main: './main.js',
|
||||
defaultExtension: 'js'
|
||||
defaultExtension: 'js',
|
||||
meta: {
|
||||
'./*.js': {
|
||||
loader: 'systemjs-angular-loader.js'
|
||||
}
|
||||
}
|
||||
},
|
||||
rxjs: {
|
||||
defaultExtension: 'js'
|
||||
|
|
|
@ -34,8 +34,9 @@
|
|||
},
|
||||
// map tells the System loader where to look for things
|
||||
map: {
|
||||
'ng-loader': './systemjs-angular-loader.js',
|
||||
// our app is within the app folder
|
||||
app: 'app',
|
||||
'app': 'app',
|
||||
|
||||
// angular bundles
|
||||
'@angular/core': 'ng:core-builds/master/bundles/core.umd.js',
|
||||
|
@ -71,7 +72,12 @@
|
|||
packages: {
|
||||
app: {
|
||||
main: './main.ts',
|
||||
defaultExtension: 'ts'
|
||||
defaultExtension: 'ts',
|
||||
meta: {
|
||||
'./*.ts': {
|
||||
loader: 'ng-loader'
|
||||
}
|
||||
}
|
||||
},
|
||||
rxjs: {
|
||||
defaultExtension: 'js'
|
||||
|
|
|
@ -31,8 +31,9 @@
|
|||
},
|
||||
// map tells the System loader where to look for things
|
||||
map: {
|
||||
'ng-loader': './systemjs-angular-loader.js',
|
||||
// our app is within the app folder
|
||||
app: 'app',
|
||||
'app': 'app',
|
||||
|
||||
// angular bundles
|
||||
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
|
||||
|
@ -58,7 +59,12 @@
|
|||
packages: {
|
||||
app: {
|
||||
main: './main.ts',
|
||||
defaultExtension: 'ts'
|
||||
defaultExtension: 'ts',
|
||||
meta: {
|
||||
'./*.ts': {
|
||||
loader: 'ng-loader'
|
||||
}
|
||||
}
|
||||
},
|
||||
rxjs: {
|
||||
defaultExtension: 'js'
|
||||
|
|
|
@ -11,7 +11,6 @@ import {
|
|||
import { Heroes } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list-auto',
|
||||
// #docregion template
|
||||
template: `
|
||||
|
|
|
@ -15,7 +15,6 @@ import {
|
|||
import { Heroes } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list-basic',
|
||||
// #enddocregion
|
||||
/* The click event calls hero.toggleState(), which
|
||||
|
|
|
@ -14,7 +14,6 @@ import {
|
|||
import { Heroes } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list-combined-transitions',
|
||||
// #docregion template
|
||||
template: `
|
||||
|
|
|
@ -11,7 +11,6 @@ import {
|
|||
import { Heroes } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list-enter-leave-states',
|
||||
// #docregion template
|
||||
template: `
|
||||
|
|
|
@ -11,7 +11,6 @@ import {
|
|||
import { Heroes } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list-enter-leave',
|
||||
// #docregion template
|
||||
template: `
|
||||
|
|
|
@ -12,7 +12,6 @@ import {
|
|||
import { Heroes } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list-groups',
|
||||
template: `
|
||||
<ul>
|
||||
|
|
|
@ -13,7 +13,6 @@ import {
|
|||
import { Heroes } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list-inline-styles',
|
||||
// #docregion template
|
||||
template: `
|
||||
|
|
|
@ -13,7 +13,6 @@ import {
|
|||
import { Heroes } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list-multistep',
|
||||
// #docregion template
|
||||
template: `
|
||||
|
|
|
@ -11,7 +11,6 @@ import {
|
|||
import { Heroes } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list-timings',
|
||||
template: `
|
||||
<ul>
|
||||
|
|
|
@ -14,7 +14,6 @@ import {
|
|||
import { Heroes } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list-twoway',
|
||||
// #docregion template
|
||||
template: `
|
||||
|
|
|
@ -3,7 +3,6 @@ import { Component, Input } from '@angular/core';
|
|||
import { Hero } from './hero';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail',
|
||||
templateUrl: './hero-detail.component.html'
|
||||
})
|
||||
|
|
|
@ -5,7 +5,6 @@ import { HeroService } from './hero.service';
|
|||
|
||||
// #docregion metadata, providers
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list',
|
||||
templateUrl: './hero-list.component.html',
|
||||
providers: [ HeroService ]
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.1.html'
|
||||
})
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
|
|
|
@ -4,7 +4,6 @@ import { MovieService } from './movie.service';
|
|||
import { IMovie } from './movie';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: [ './app.component.css' ],
|
||||
|
|
|
@ -8,7 +8,6 @@ import { MovieService } from './movie.service';
|
|||
|
||||
// #docregion component
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'movie-list',
|
||||
templateUrl: './movie-list.component.html',
|
||||
// #docregion style-url
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
|
||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||
<!-- #docregion moduleId -->
|
||||
<script>window.module = 'aot';</script>
|
||||
<!-- #enddocregion moduleId -->
|
||||
</head>
|
||||
<body>
|
||||
<my-app>Loading...</my-app>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
'use strict'; // necessary for es6 output in node
|
||||
|
||||
import { browser, element, by, ElementFinder } from 'protractor';
|
||||
|
||||
describe('Cookbook: component-relative paths', function () {
|
||||
|
||||
interface Page {
|
||||
title: ElementFinder;
|
||||
absComp: ElementFinder;
|
||||
relComp: ElementFinder;
|
||||
|
||||
}
|
||||
function getPageStruct() {
|
||||
return {
|
||||
title: element( by.tagName( 'h1' )),
|
||||
absComp: element( by.css( 'absolute-path div' ) ),
|
||||
relComp: element( by.css( 'relative-path div' ) )
|
||||
};
|
||||
}
|
||||
|
||||
let page: Page;
|
||||
beforeAll(function () {
|
||||
browser.get('');
|
||||
page = getPageStruct();
|
||||
});
|
||||
|
||||
it('should display title of the sample', function () {
|
||||
expect(element(by.tagName('h1')).getText()).toContain('Paths');
|
||||
});
|
||||
|
||||
it('should have absolute-path element', function () {
|
||||
expect(page.absComp.isPresent()).toBe(true, 'no <absolute-path> element');
|
||||
});
|
||||
|
||||
it('should display the absolute path text', function () {
|
||||
expect(page.absComp.getText()).toContain('Absolute');
|
||||
});
|
||||
|
||||
it('should display the component-relative path text', function () {
|
||||
expect(page.relComp.getText()).toContain('Component-relative');
|
||||
});
|
||||
});
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"description": "Module-relative Paths",
|
||||
"basePath": "src/",
|
||||
"files": [
|
||||
"!**/*.d.ts",
|
||||
"!**/*.js"
|
||||
],
|
||||
"tags": [ "cookbook" ]
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
// #docregion
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
template:
|
||||
`<h1>Absolute & <i>Component-Relative</i> Paths</h1>
|
||||
<absolute-path></absolute-path>
|
||||
<relative-path></relative-path>
|
||||
`
|
||||
})
|
||||
export class AppComponent {}
|
|
@ -1,18 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { SomeAbsoluteComponent, SomeRelativeComponent } from './some.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
BrowserModule
|
||||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
SomeAbsoluteComponent,
|
||||
SomeRelativeComponent
|
||||
],
|
||||
bootstrap: [ AppComponent ]
|
||||
})
|
||||
export class AppModule { }
|
|
@ -1,22 +0,0 @@
|
|||
/* #docregion */
|
||||
div.absolute {
|
||||
background: beige;
|
||||
border: 1px solid darkred;
|
||||
color: red;
|
||||
margin: 8px;
|
||||
max-width: 20em;
|
||||
padding: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.relative {
|
||||
background: powderblue;
|
||||
border: 1px solid darkblue;
|
||||
color: Blue;
|
||||
font-style: italic;
|
||||
margin: 8px;
|
||||
max-width: 20em;
|
||||
padding: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<!-- #docregion -->
|
||||
<div class={{class}}>
|
||||
{{type}}<br>{{path}}
|
||||
</div>
|
|
@ -1,37 +0,0 @@
|
|||
// #docregion
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
///////// Using Absolute Paths ///////
|
||||
|
||||
// #docregion absolute-config
|
||||
@Component({
|
||||
selector: 'absolute-path',
|
||||
templateUrl: 'app/some.component.html',
|
||||
styleUrls: ['app/some.component.css']
|
||||
})
|
||||
// #enddocregion absolute-config
|
||||
export class SomeAbsoluteComponent {
|
||||
class = 'absolute';
|
||||
type = 'Absolute template & style URLs';
|
||||
path = 'app/path.component.html';
|
||||
}
|
||||
|
||||
///////// Using Relative Paths ///////
|
||||
|
||||
// #docregion relative-config
|
||||
@Component({
|
||||
// #docregion module-id
|
||||
moduleId: module.id,
|
||||
// #enddocregion module-id
|
||||
selector: 'relative-path',
|
||||
templateUrl: './some.component.html',
|
||||
styleUrls: ['./some.component.css']
|
||||
})
|
||||
// #enddocregion relative-config
|
||||
|
||||
export class SomeRelativeComponent {
|
||||
class = 'relative';
|
||||
type = 'Component-relative template & style URLs';
|
||||
path = 'path.component.html';
|
||||
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<base href="/">
|
||||
|
||||
<title>
|
||||
Component-Relative Paths
|
||||
</title>
|
||||
|
||||
<!-- #docregion style -->
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
<!-- #enddocregion style -->
|
||||
|
||||
<!-- Polyfills -->
|
||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||
|
||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||
|
||||
<script src="systemjs.config.js"></script>
|
||||
<script>
|
||||
System.import('main.js').catch(function(err){ console.error(err); });
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<my-app>Loading app...</my-app>
|
||||
</body>
|
||||
</html>
|
|
@ -1,5 +0,0 @@
|
|||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
|
@ -7,7 +7,6 @@ import { UserContextService } from './user-context.service';
|
|||
import { UserService } from './user.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html',
|
||||
// #docregion providers
|
||||
|
|
|
@ -5,7 +5,6 @@ import { FormGroup } from '@angular/forms';
|
|||
import { QuestionBase } from './question-base';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'df-question',
|
||||
templateUrl: './dynamic-form-question.component.html'
|
||||
})
|
||||
|
|
|
@ -6,7 +6,6 @@ import { QuestionBase } from './question-base';
|
|||
import { QuestionControlService } from './question-control.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'dynamic-form',
|
||||
templateUrl: './dynamic-form.component.html',
|
||||
providers: [ QuestionControlService ]
|
||||
|
|
|
@ -8,7 +8,6 @@ import { Hero } from '../shared/hero';
|
|||
import { forbiddenNameValidator } from '../shared/forbidden-name.directive';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-form-reactive3',
|
||||
templateUrl: './hero-form-reactive.component.html'
|
||||
})
|
||||
|
|
|
@ -7,7 +7,6 @@ import { Component } from '@angular/core';
|
|||
import { Hero } from '../shared/hero';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-form-template1',
|
||||
templateUrl: './hero-form-template1.component.html'
|
||||
})
|
||||
|
|
|
@ -7,7 +7,6 @@ import { NgForm } from '@angular/forms';
|
|||
import { Hero } from '../shared/hero';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-form-template2',
|
||||
templateUrl: './hero-form-template2.component.html'
|
||||
})
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html',
|
||||
styles: [
|
||||
|
|
|
@ -2,7 +2,6 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|||
|
||||
// #docregion
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-confirm',
|
||||
templateUrl: './confirm.component.html'
|
||||
})
|
||||
|
|
|
@ -3,7 +3,6 @@ import { Attribute, Component, Inject, Optional } from '@angular/core';
|
|||
// #docregion
|
||||
// #docregion templateUrl
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-title',
|
||||
templateUrl: './hero-title.component.html'
|
||||
})
|
||||
|
|
|
@ -8,7 +8,6 @@ export class AppComponent {
|
|||
|
||||
AppComponent.annotations = [
|
||||
new Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html',
|
||||
styles: [
|
||||
|
|
|
@ -16,7 +16,6 @@ export class ConfirmComponent {
|
|||
|
||||
ConfirmComponent.annotations = [
|
||||
new Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-confirm',
|
||||
templateUrl: './confirm.component.html',
|
||||
inputs: [
|
||||
|
|
|
@ -16,7 +16,6 @@ export class HeroTitleComponent {
|
|||
// #docregion templateUrl
|
||||
HeroTitleComponent.annotations = [
|
||||
new Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-title',
|
||||
templateUrl: './hero-title.component.html'
|
||||
})
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html',
|
||||
styles: [
|
||||
|
|
|
@ -2,7 +2,6 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|||
|
||||
// #docregion
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-confirm',
|
||||
templateUrl: './confirm.component.html'
|
||||
})
|
||||
|
|
|
@ -3,7 +3,6 @@ import { Attribute, Component, Inject, Optional } from '@angular/core';
|
|||
// #docregion
|
||||
// #docregion templateUrl
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-title',
|
||||
templateUrl: './hero-title.component.html'
|
||||
})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
'use strict'; // necessary for es6 output in node
|
||||
'use strict'; // necessary for es6 output in node
|
||||
|
||||
import { browser, element, by } from 'protractor';
|
||||
|
||||
|
@ -65,9 +65,4 @@ describe('Component Style Tests', function () {
|
|||
expect(externalLi.getCssValue('listStyleType')).not.toEqual('square');
|
||||
});
|
||||
|
||||
it('supports relative loading with moduleId', function() {
|
||||
let host = element(by.css('quest-summary'));
|
||||
expect(host.getCssValue('color')).toEqual('rgba(255, 255, 255, 1)'); // #ffffff
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -4,7 +4,6 @@ import { Component, ViewEncapsulation } from '@angular/core';
|
|||
|
||||
// #docregion
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'quest-summary',
|
||||
// #docregion urls
|
||||
templateUrl: './quest-summary.component.html',
|
||||
|
|
|
@ -5,7 +5,6 @@ import { Component } from '@angular/core';
|
|||
import { Hero } from './hero';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-form',
|
||||
templateUrl: './hero-form.component.html'
|
||||
})
|
||||
|
|
|
@ -4,7 +4,6 @@ import { HeroTaxReturn } from './hero';
|
|||
import { HeroTaxReturnService } from './hero-tax-return.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-tax-return',
|
||||
templateUrl: './hero-tax-return.component.html',
|
||||
styleUrls: [ './hero-tax-return.component.css' ],
|
||||
|
|
|
@ -6,7 +6,6 @@ import { Villain, VillainsService } from './villains.service';
|
|||
|
||||
// #docregion metadata
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'villains-list',
|
||||
templateUrl: './villains-list.component.html',
|
||||
providers: [ VillainsService ]
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
// Set the base for module-relative URLs
|
||||
moduleId: module.id,
|
||||
|
||||
// Declare the tag name in index.html to where the component attaches
|
||||
selector: 'hello-world',
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// #docregion
|
||||
import { Component } from '@angular/core';
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
|
|
|
@ -75,7 +75,6 @@ export class DoCheckComponent implements DoCheck {
|
|||
/***************************************/
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'do-check-parent',
|
||||
templateUrl: './do-check-parent.component.html',
|
||||
styles: ['.parent {background: Lavender}']
|
||||
|
|
|
@ -49,7 +49,6 @@ export class OnChangesComponent implements OnChanges {
|
|||
/***************************************/
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'on-changes-parent',
|
||||
templateUrl: './on-changes-parent.component.html',
|
||||
styles: ['.parent {background: Lavender;}']
|
||||
|
|
|
@ -4,7 +4,6 @@ import { Component } from '@angular/core';
|
|||
import { LoggerService } from './logger.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'spy-parent',
|
||||
templateUrl: './spy.component.html',
|
||||
styles: [
|
||||
|
|
|
@ -4,7 +4,6 @@ import { Component } from '@angular/core';
|
|||
import { heroes } from './hero';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: [ './app.component.css' ]
|
||||
|
|
|
@ -5,7 +5,6 @@ import { Contact, ContactService } from './contact.service';
|
|||
import { UserService } from '../user.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-contact',
|
||||
templateUrl: './contact.component.html',
|
||||
styleUrls: [ './contact.component.css' ]
|
||||
|
|
|
@ -6,7 +6,6 @@ import { Contact, ContactService } from './contact.service';
|
|||
import { UserService } from '../core/user.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-contact',
|
||||
templateUrl: './contact.component.html',
|
||||
styleUrls: [ './contact.component.css' ]
|
||||
|
|
|
@ -3,7 +3,6 @@ import { Component, Input } from '@angular/core';
|
|||
import { UserService } from '../core/user.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-title',
|
||||
templateUrl: './title.component.html',
|
||||
})
|
||||
|
|
|
@ -7,7 +7,6 @@ import { UserService } from './user.service';
|
|||
// #docregion v1
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-title',
|
||||
templateUrl: './title.component.html',
|
||||
})
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
|
|
|
@ -5,7 +5,6 @@ import { Component } from '@angular/core';
|
|||
import { HEROES } from './heroes';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'flying-heroes',
|
||||
templateUrl: './flying-heroes.component.html',
|
||||
styles: ['#flyers, #all {font-style: italic}']
|
||||
|
@ -50,7 +49,6 @@ export class FlyingHeroesComponent {
|
|||
////// Identical except for impure pipe //////
|
||||
// #docregion impure-component
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'flying-heroes-impure',
|
||||
templateUrl: './flying-heroes-impure.component.html',
|
||||
// #enddocregion impure-component
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
template: `
|
||||
<div class="container">
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
template: `
|
||||
<div class="container">
|
||||
|
|
|
@ -6,9 +6,8 @@ import { Hero } from './data-model';
|
|||
import { HeroService } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'demo.component.html'
|
||||
templateUrl: './demo.component.html'
|
||||
})
|
||||
export class DemoComponent {
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import { FormControl } from '@angular/forms';
|
|||
// #enddocregion
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail-1',
|
||||
templateUrl: './hero-detail-1.component.html'
|
||||
})
|
||||
|
|
|
@ -5,7 +5,6 @@ import { FormControl, FormGroup } from '@angular/forms';
|
|||
// #enddocregion imports
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail-2',
|
||||
templateUrl: './hero-detail-2.component.html'
|
||||
})
|
||||
|
|
|
@ -5,7 +5,6 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|||
// #enddocregion imports
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail-3',
|
||||
templateUrl: './hero-detail-3.component.html'
|
||||
})
|
||||
|
|
|
@ -5,7 +5,6 @@ import { FormBuilder, FormGroup } from '@angular/forms';
|
|||
// #enddocregion imports
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail-3',
|
||||
templateUrl: './hero-detail-3.component.html'
|
||||
})
|
||||
|
|
|
@ -7,7 +7,6 @@ import { states } from './data-model';
|
|||
// #enddocregion imports
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail-4',
|
||||
templateUrl: './hero-detail-4.component.html'
|
||||
})
|
||||
|
|
|
@ -5,7 +5,6 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|||
import { states } from './data-model';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail-5',
|
||||
templateUrl: './hero-detail-5.component.html'
|
||||
})
|
||||
|
|
|
@ -11,7 +11,6 @@ import { Hero, states } from './data-model';
|
|||
////////// 6 ////////////////////
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail-6',
|
||||
templateUrl: './hero-detail-5.component.html'
|
||||
})
|
||||
|
|
|
@ -11,7 +11,6 @@ import { Address, Hero, states } from './data-model';
|
|||
// #enddocregion imports
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail-7',
|
||||
templateUrl: './hero-detail-5.component.html'
|
||||
})
|
||||
|
|
|
@ -7,7 +7,6 @@ import { Address, Hero, states } from './data-model';
|
|||
// #enddocregion imports
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail-8',
|
||||
templateUrl: './hero-detail-8.component.html'
|
||||
})
|
||||
|
|
|
@ -10,7 +10,6 @@ import { HeroService } from './hero.service';
|
|||
|
||||
// #docregion metadata
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail',
|
||||
templateUrl: './hero-detail.component.html'
|
||||
})
|
||||
|
|
|
@ -7,9 +7,8 @@ import { Hero } from './data-model';
|
|||
import { HeroService } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list',
|
||||
templateUrl: 'hero-list.component.html'
|
||||
templateUrl: './hero-list.component.html'
|
||||
})
|
||||
export class HeroListComponent implements OnInit {
|
||||
heroes: Observable<Hero[]>;
|
||||
|
|
|
@ -5,7 +5,6 @@ import { Router } from '@angular/router';
|
|||
import { slideInDownAnimation } from './animations';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
templateUrl: './compose-message.component.html',
|
||||
styles: [ ':host { position: relative; bottom: 10%; }' ],
|
||||
animations: [ slideInDownAnimation ]
|
||||
|
|
|
@ -5,7 +5,6 @@ import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browse
|
|||
|
||||
@Component({
|
||||
selector: 'bypass-security',
|
||||
moduleId: module.id,
|
||||
templateUrl: './bypass-security.component.html',
|
||||
})
|
||||
export class BypassSecurityComponent {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'inner-html-binding',
|
||||
templateUrl: './inner-html-binding.component.html',
|
||||
})
|
||||
|
|
|
@ -6,7 +6,6 @@ import { HeroService } from './hero.service.promise';
|
|||
|
||||
@Component({
|
||||
selector: 'hero-list-promise',
|
||||
moduleId: module.id,
|
||||
templateUrl: './hero-list.component.html',
|
||||
providers: [ HeroService ],
|
||||
styles: ['.error {color:red;}']
|
||||
|
|
|
@ -5,7 +5,6 @@ import { Hero } from './hero';
|
|||
import { HeroService } from './hero.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list',
|
||||
templateUrl: './hero-list.component.html',
|
||||
providers: [ HeroService ],
|
||||
|
|
|
@ -16,7 +16,6 @@ import { Subject } from 'rxjs/Subject';
|
|||
import { WikipediaService } from './wikipedia.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-wiki-smart',
|
||||
template: `
|
||||
<h1>Smarter Wikipedia Demo</h1>
|
||||
|
|
|
@ -4,7 +4,6 @@ import { Component } from '@angular/core';
|
|||
import { Hero, heroes } from './hero';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: [ './app.component.css' ]
|
||||
|
|
|
@ -4,7 +4,6 @@ import { Component } from '@angular/core';
|
|||
import { HeroService } from './heroes';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-app',
|
||||
template: `
|
||||
<toh-heroes></toh-heroes>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-app',
|
||||
template: `
|
||||
Tour of Heroes
|
||||
|
|
|
@ -4,7 +4,6 @@ import { Hero, HeroService } from './heroes';
|
|||
import { ExceptionService, SpinnerService, ToastService } from './core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'sg-app',
|
||||
templateUrl: './app.component.html',
|
||||
providers: [HeroService, ExceptionService, SpinnerService, ToastService]
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-heroes',
|
||||
templateUrl: './heroes.component.html'
|
||||
})
|
||||
|
|
|
@ -4,7 +4,6 @@ import { Component } from '@angular/core';
|
|||
import { FilterTextService } from '../shared/filter-text/filter-text.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-heroes',
|
||||
templateUrl: './heroes.component.html'
|
||||
})
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-filter-text',
|
||||
template: '<input type="text" id="filterText" [(ngModel)]="filter" (keyup)="filterChanged($event)" />'
|
||||
})
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-nav',
|
||||
templateUrl: './nav.component.html',
|
||||
styleUrls: ['./nav.component.css'],
|
||||
|
|
|
@ -6,7 +6,6 @@ import { LoggerService } from '../logger.service';
|
|||
import { SpinnerState, SpinnerService } from './spinner.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-spinner',
|
||||
templateUrl: './spinner.component.html',
|
||||
styleUrls: ['./spinner.component.css']
|
||||
|
|
|
@ -4,7 +4,6 @@ import { LoggerService } from '../core/logger.service';
|
|||
import { SpinnerService } from '../core/spinner/spinner.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-heroes',
|
||||
templateUrl: './heroes.component.html'
|
||||
})
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-nav',
|
||||
templateUrl: './nav.component.html',
|
||||
styleUrls: ['./nav.component.css'],
|
||||
|
|
|
@ -3,7 +3,6 @@ import { Component } from '@angular/core';
|
|||
import { LoggerService } from '../core/logger.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-heroes',
|
||||
templateUrl: './heroes.component.html'
|
||||
})
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue