feat(aio): delete unused kruft
This commit is contained in:
parent
31d42d87c6
commit
a9096437fd
|
@ -8,9 +8,12 @@ describe('site App', function() {
|
|||
});
|
||||
|
||||
it('should show features text after clicking "Features"', () => {
|
||||
page.navigateTo();
|
||||
page.featureLink.click().then(() => {
|
||||
expect(page.getDocViewerText()).toContain('Progressive web apps');
|
||||
});
|
||||
page.navigateTo()
|
||||
.then(() => {
|
||||
return page.featureLink.click();
|
||||
})
|
||||
.then(() => {
|
||||
expect(page.getDocViewerText()).toContain('Progressive web apps');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,38 +1,31 @@
|
|||
// /* tslint:disable:no-unused-variable */
|
||||
|
||||
// import { TestBed, async } from '@angular/core/testing';
|
||||
// import { AppComponent } from './app.component';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AppComponent } from './app.component';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
import { NavEngine } from './nav-engine/nav-engine.service';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
// beforeEach(() => {
|
||||
// TestBed.configureTestingModule({
|
||||
// declarations: [
|
||||
// AppComponent
|
||||
// ],
|
||||
// });
|
||||
// TestBed.compileComponents();
|
||||
// });
|
||||
it('should work', () => {
|
||||
expect(true).toBe(true);
|
||||
let component: AppComponent;
|
||||
let fixture: ComponentFixture<AppComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ AppModule ],
|
||||
providers: [
|
||||
{ provide: NavEngine, useValue: { currentDoc: undefined } }
|
||||
]
|
||||
});
|
||||
TestBed.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AppComponent);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
// it('should create the app', async(() => {
|
||||
// const fixture = TestBed.createComponent(AppComponent);
|
||||
// const app = fixture.debugElement.componentInstance;
|
||||
// expect(app).toBeTruthy();
|
||||
// }));
|
||||
|
||||
// it(`should have as title 'app works!'`, async(() => {
|
||||
// const fixture = TestBed.createComponent(AppComponent);
|
||||
// const app = fixture.debugElement.componentInstance;
|
||||
// expect(app.title).toEqual('app works!');
|
||||
// }));
|
||||
|
||||
// it('should render title in a h1 tag', async(() => {
|
||||
// const fixture = TestBed.createComponent(AppComponent);
|
||||
// fixture.detectChanges();
|
||||
// const compiled = fixture.debugElement.nativeElement;
|
||||
// expect(compiled.querySelector('h1').textContent).toContain('app works!');
|
||||
// }));
|
||||
// });
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { NavEngine } from './nav-engine/nav-engine';
|
||||
|
||||
import { NavEngine } from './nav-engine/nav-engine.service';
|
||||
|
||||
@Component({
|
||||
selector: 'aio-shell',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss']
|
||||
styleUrls: ['./app.component.scss']
|
||||
})
|
||||
export class AppComponent {
|
||||
title = 'app works!';
|
||||
constructor(public navEngine: NavEngine) {}
|
||||
}
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { AppComponent } from './app.component';
|
||||
import { MdToolbarModule } from '@angular/material/toolbar';
|
||||
import { MdButtonModule} from '@angular/material/button';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { DocViewerComponent } from './doc-viewer/doc-viewer.component';
|
||||
import { NavEngine } from './nav-engine/nav-engine';
|
||||
import { NavLinkDirective } from './nav-engine/nav-link';
|
||||
import { NavEngine } from './nav-engine/nav-engine.service';
|
||||
import { NavLinkDirective } from './nav-engine/nav-link.directive';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
DocViewerComponent,
|
||||
NavLinkDirective
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
MdToolbarModule.forRoot(),
|
||||
MdButtonModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
DocViewerComponent,
|
||||
NavLinkDirective
|
||||
],
|
||||
providers: [NavEngine],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import { Component, OnInit, Input, ElementRef, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, Input, ElementRef, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'aio-doc-viewer',
|
||||
templateUrl: './doc-viewer.component.html',
|
||||
styleUrls: ['./doc-viewer.component.css'],
|
||||
template: ''
|
||||
// TODO(robwormald): shadow DOM and emulated don't work here (?!)
|
||||
// encapsulation: ViewEncapsulation.Native
|
||||
})
|
||||
export class DocViewerComponent implements OnInit {
|
||||
export class DocViewerComponent {
|
||||
|
||||
@Input()
|
||||
set doc(currentDoc) {
|
||||
|
@ -18,7 +17,4 @@ export class DocViewerComponent implements OnInit {
|
|||
|
||||
constructor(private element: ElementRef) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<p>
|
||||
docs-app works!
|
||||
</p>
|
|
@ -1,28 +0,0 @@
|
|||
// /* tslint:disable:no-unused-variable */
|
||||
// import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
// import { By } from '@angular/platform-browser';
|
||||
// import { DebugElement } from '@angular/core';
|
||||
|
||||
// import { DocsAppComponent } from './docs-app.component';
|
||||
|
||||
// describe('DocsAppComponent', () => {
|
||||
// let component: DocsAppComponent;
|
||||
// let fixture: ComponentFixture<DocsAppComponent>;
|
||||
|
||||
// beforeEach(async(() => {
|
||||
// TestBed.configureTestingModule({
|
||||
// declarations: [ DocsAppComponent ]
|
||||
// })
|
||||
// .compileComponents();
|
||||
// }));
|
||||
|
||||
// beforeEach(() => {
|
||||
// fixture = TestBed.createComponent(DocsAppComponent);
|
||||
// component = fixture.componentInstance;
|
||||
// fixture.detectChanges();
|
||||
// });
|
||||
|
||||
// it('should create', () => {
|
||||
// expect(component).toBeTruthy();
|
||||
// });
|
||||
// });
|
|
@ -1,15 +0,0 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'aio-ngio-docs',
|
||||
templateUrl: './docs-app.component.html',
|
||||
styleUrls: ['./docs-app.component.css']
|
||||
})
|
||||
export class DocsAppComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { DocsAppComponent } from './docs-app.component';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild([
|
||||
{ path: '', pathMatch: 'full', component: DocsAppComponent}
|
||||
])
|
||||
],
|
||||
declarations: [
|
||||
DocsAppComponent
|
||||
]
|
||||
})
|
||||
export class DocsAppModule {
|
||||
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
<p>
|
||||
home-page works!
|
||||
</p>
|
|
@ -1,28 +0,0 @@
|
|||
// /* tslint:disable:no-unused-variable */
|
||||
// import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
// import { By } from '@angular/platform-browser';
|
||||
// import { DebugElement } from '@angular/core';
|
||||
|
||||
// import { HomePageComponent } from './home-page.component';
|
||||
|
||||
// describe('HomePageComponent', () => {
|
||||
// let component: HomePageComponent;
|
||||
// let fixture: ComponentFixture<HomePageComponent>;
|
||||
|
||||
// beforeEach(async(() => {
|
||||
// TestBed.configureTestingModule({
|
||||
// declarations: [ HomePageComponent ]
|
||||
// })
|
||||
// .compileComponents();
|
||||
// }));
|
||||
|
||||
// beforeEach(() => {
|
||||
// fixture = TestBed.createComponent(HomePageComponent);
|
||||
// component = fixture.componentInstance;
|
||||
// fixture.detectChanges();
|
||||
// });
|
||||
|
||||
// it('should create', () => {
|
||||
// expect(component).toBeTruthy();
|
||||
// });
|
||||
// });
|
|
@ -1,15 +0,0 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'aio-home-page',
|
||||
templateUrl: './home-page.component.html',
|
||||
styleUrls: ['./home-page.component.css']
|
||||
})
|
||||
export class HomePageComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HomePageComponent } from './home-page.component';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: HomePageComponent }
|
||||
])
|
||||
],
|
||||
declarations: [HomePageComponent]
|
||||
})
|
||||
export class HomePageModule { }
|
|
@ -1,5 +1,7 @@
|
|||
declare var fetch;
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
// TODO(robwormald): figure out how to handle this properly...
|
||||
const siteMap = [
|
||||
{ 'title': 'Home', 'url': 'assets/documents/home.html', id: 'home'},
|
||||
|
@ -7,7 +9,7 @@ const siteMap = [
|
|||
{ 'title': 'News', 'url': 'assets/documents/news.html', id: 'news'}
|
||||
];
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class NavEngine {
|
||||
currentDoc: any;
|
||||
constructor() {}
|
||||
|
@ -15,7 +17,7 @@ export class NavEngine {
|
|||
console.log('navigating to', documentId);
|
||||
const doc = siteMap.find(d => d.id === documentId);
|
||||
if (doc) {
|
||||
this._fetchDoc(doc.url)
|
||||
this.fetchDoc(doc.url)
|
||||
.then(content => {
|
||||
console.log('fetched content', content);
|
||||
this.currentDoc = Object.assign({}, doc, {content});
|
||||
|
@ -23,7 +25,7 @@ export class NavEngine {
|
|||
}
|
||||
}
|
||||
|
||||
private _fetchDoc(url) {
|
||||
private fetchDoc(url) {
|
||||
// TODO(robwormald): use Http proper once new API is done.
|
||||
return fetch(url).then(res => res.text());
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import { Directive, HostListener, Input } from '@angular/core';
|
||||
import { NavEngine } from './nav-engine';
|
||||
import { NavEngine } from './nav-engine.service';
|
||||
|
||||
@Directive({
|
||||
selector: '[aioNavLink]'
|
|
@ -1,16 +0,0 @@
|
|||
/* tslint:disable:no-unused-variable */
|
||||
|
||||
import { TestBed, async, inject } from '@angular/core/testing';
|
||||
import { PageManagerService } from './page-manager.service';
|
||||
|
||||
describe('PageManagerService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [PageManagerService]
|
||||
});
|
||||
});
|
||||
|
||||
it('should ...', inject([PageManagerService], (service: PageManagerService) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
|
@ -1,8 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
export class PageManagerService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>(v42) One framework - Angular</title>
|
||||
<title>Angular Docs v.2</title>
|
||||
<base href="/">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
|
Loading…
Reference in New Issue