This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@angular/core'; | |
| import { ChildComponent } from './child.component'; | |
| @Component({ | |
| selector: 'app-child', | |
| template: '', | |
| providers: [ | |
| { | |
| provide: ChildComponent, | |
| useClass: ChildStubComponent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
| import { ParentComponent } from './parent.component'; | |
| import { ChildComponent } from '../child/child.component'; | |
| import { ChildStubComponent } from '../child/child-stub.component.spec'; | |
| describe('ParentComponent', () => { | |
| let component: ParentComponent; | |
| let fixture: ComponentFixture<ParentComponent>; | |
| beforeEach(async(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@angular/core'; | |
| @Component({ | |
| selector: 'app-child', | |
| template: '' | |
| }) | |
| export class ChildStubComponent { | |
| timeStamp; | |
| ngOnInit() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@angular/core'; | |
| @Component({ | |
| selector: 'app-child', | |
| template: '' | |
| }) | |
| export class ChildStubComponent { | |
| updateTimeStamp() {} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
| import { ParentComponent } from './parent.component'; | |
| import { ChildComponent } from '../child/child.component'; | |
| describe('ParentComponent', () => { | |
| let component: ParentComponent; | |
| let fixture: ComponentFixture<ParentComponent>; | |
| beforeEach(async(() => { | |
| TestBed.configureTestingModule({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, ViewChild } from '@angular/core'; | |
| import { ChildComponent } from '../child/child.component'; | |
| @Component({ | |
| selector: 'app-parent', | |
| template: ` | |
| <button type="button" (click)="update()">Update</button> | |
| <br> | |
| <app-child></app-child>` | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit } from '@angular/core'; | |
| @Component({ | |
| selector: 'app-child', | |
| template: `Timestamp: {{timeStamp}}` | |
| }) | |
| export class ChildComponent implements OnInit { | |
| public timeStamp: Date; | |
| ngOnInit() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h1> | |
| Environment | |
| </h1> | |
| <pre>{{env | json}}</pre> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div style="text-align:center"> | |
| <h1> | |
| Welcome to {{ title }}! | |
| </h1> | |
| <img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="> | |
| </div> | |
| <h2>Example</h2> | |
| <enl-example-ng6-lib></enl-example-ng6-lib> | |
| <enl-foo></enl-foo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Public API Surface of example-ng6-lib | |
| */ | |
| export * from './lib/example-ng6-lib.service'; | |
| export * from './lib/example-ng6-lib.component'; | |
| export * from './lib/example-ng6-lib.module'; | |
| export * from './lib/foo/foo.component'; |
NewerOlder