docs(aio): update migrated content from anguar.io
This commit is contained in:

committed by
Pete Bacon Darwin

parent
ff82756415
commit
fd72fad8fd
33
aio/content/examples/setup/src/app/app.component.spec.ts
Normal file
33
aio/content/examples/setup/src/app/app.component.spec.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { DebugElement } from '@angular/core';
|
||||
|
||||
describe('AppComponent', function () {
|
||||
let de: DebugElement;
|
||||
let comp: AppComponent;
|
||||
let fixture: ComponentFixture<AppComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AppComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AppComponent);
|
||||
comp = fixture.componentInstance;
|
||||
de = fixture.debugElement.query(By.css('h1'));
|
||||
});
|
||||
|
||||
it('should create component', () => expect(comp).toBeDefined() );
|
||||
|
||||
it('should have expected <h1> text', () => {
|
||||
fixture.detectChanges();
|
||||
const h1 = de.nativeElement;
|
||||
expect(h1.innerText).toMatch(/angular/i,
|
||||
'<h1> should say something about "Angular"');
|
||||
});
|
||||
});
|
8
aio/content/examples/setup/src/app/app.component.ts
Normal file
8
aio/content/examples/setup/src/app/app.component.ts
Normal file
@ -0,0 +1,8 @@
|
||||
// #docregion
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
template: `<h1>Hello {{name}}</h1>`
|
||||
})
|
||||
export class AppComponent { name = 'Angular'; }
|
11
aio/content/examples/setup/src/app/app.module.ts
Normal file
11
aio/content/examples/setup/src/app/app.module.ts
Normal file
@ -0,0 +1,11 @@
|
||||
// #docregion
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [ BrowserModule ],
|
||||
declarations: [ AppComponent ],
|
||||
bootstrap: [ AppComponent ]
|
||||
})
|
||||
export class AppModule { }
|
Reference in New Issue
Block a user