feat(aio): delete unused kruft

This commit is contained in:
Ward Bell 2017-02-02 23:02:23 -08:00 committed by Igor Minar
parent 31d42d87c6
commit a9096437fd
22 changed files with 55 additions and 210 deletions

View File

@ -8,9 +8,12 @@ describe('site App', function() {
}); });
it('should show features text after clicking "Features"', () => { it('should show features text after clicking "Features"', () => {
page.navigateTo(); page.navigateTo()
page.featureLink.click().then(() => { .then(() => {
expect(page.getDocViewerText()).toContain('Progressive web apps'); return page.featureLink.click();
}); })
.then(() => {
expect(page.getDocViewerText()).toContain('Progressive web apps');
});
}); });
}); });

View File

@ -1,38 +1,31 @@
// /* tslint:disable:no-unused-variable */ // /* tslint:disable:no-unused-variable */
// import { TestBed, async } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
// import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { AppModule } from './app.module';
import { NavEngine } from './nav-engine/nav-engine.service';
describe('AppComponent', () => { describe('AppComponent', () => {
// beforeEach(() => { let component: AppComponent;
// TestBed.configureTestingModule({ let fixture: ComponentFixture<AppComponent>;
// declarations: [
// AppComponent beforeEach(async(() => {
// ], TestBed.configureTestingModule({
// }); imports: [ AppModule ],
// TestBed.compileComponents(); providers: [
// }); { provide: NavEngine, useValue: { currentDoc: undefined } }
it('should work', () => { ]
expect(true).toBe(true); });
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!');
// }));
// });

View File

@ -1,11 +1,12 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { NavEngine } from './nav-engine/nav-engine';
import { NavEngine } from './nav-engine/nav-engine.service';
@Component({ @Component({
selector: 'aio-shell', selector: 'aio-shell',
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'] styleUrls: ['./app.component.scss']
}) })
export class AppComponent { export class AppComponent {
title = 'app works!';
constructor(public navEngine: NavEngine) {} constructor(public navEngine: NavEngine) {}
} }

View File

@ -1,24 +1,24 @@
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { MdToolbarModule } from '@angular/material/toolbar'; import { MdToolbarModule } from '@angular/material/toolbar';
import { MdButtonModule} from '@angular/material/button'; import { MdButtonModule} from '@angular/material/button';
import { AppComponent } from './app.component';
import { DocViewerComponent } from './doc-viewer/doc-viewer.component'; import { DocViewerComponent } from './doc-viewer/doc-viewer.component';
import { NavEngine } from './nav-engine/nav-engine'; import { NavEngine } from './nav-engine/nav-engine.service';
import { NavLinkDirective } from './nav-engine/nav-link'; import { NavLinkDirective } from './nav-engine/nav-link.directive';
@NgModule({ @NgModule({
declarations: [
AppComponent,
DocViewerComponent,
NavLinkDirective
],
imports: [ imports: [
BrowserModule, BrowserModule,
MdToolbarModule.forRoot(), MdToolbarModule.forRoot(),
MdButtonModule.forRoot() MdButtonModule.forRoot()
], ],
declarations: [
AppComponent,
DocViewerComponent,
NavLinkDirective
],
providers: [NavEngine], providers: [NavEngine],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })

View File

@ -1,13 +1,12 @@
import { Component, OnInit, Input, ElementRef, ViewEncapsulation } from '@angular/core'; import { Component, Input, ElementRef, ViewEncapsulation } from '@angular/core';
@Component({ @Component({
selector: 'aio-doc-viewer', selector: 'aio-doc-viewer',
templateUrl: './doc-viewer.component.html', template: ''
styleUrls: ['./doc-viewer.component.css'],
// TODO(robwormald): shadow DOM and emulated don't work here (?!) // TODO(robwormald): shadow DOM and emulated don't work here (?!)
// encapsulation: ViewEncapsulation.Native // encapsulation: ViewEncapsulation.Native
}) })
export class DocViewerComponent implements OnInit { export class DocViewerComponent {
@Input() @Input()
set doc(currentDoc) { set doc(currentDoc) {
@ -18,7 +17,4 @@ export class DocViewerComponent implements OnInit {
constructor(private element: ElementRef) { } constructor(private element: ElementRef) { }
ngOnInit() {
}
} }

View File

@ -1,3 +0,0 @@
<p>
docs-app works!
</p>

View File

@ -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();
// });
// });

View File

@ -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() {
}
}

View File

@ -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 {
}

View File

@ -1,3 +0,0 @@
<p>
home-page works!
</p>

View File

@ -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();
// });
// });

View File

@ -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() {
}
}

View File

@ -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 { }

View File

@ -1,5 +1,7 @@
declare var fetch; declare var fetch;
import { Injectable } from '@angular/core';
// TODO(robwormald): figure out how to handle this properly... // TODO(robwormald): figure out how to handle this properly...
const siteMap = [ const siteMap = [
{ 'title': 'Home', 'url': 'assets/documents/home.html', id: 'home'}, { 'title': 'Home', 'url': 'assets/documents/home.html', id: 'home'},
@ -7,7 +9,7 @@ const siteMap = [
{ 'title': 'News', 'url': 'assets/documents/news.html', id: 'news'} { 'title': 'News', 'url': 'assets/documents/news.html', id: 'news'}
]; ];
@Injectable()
export class NavEngine { export class NavEngine {
currentDoc: any; currentDoc: any;
constructor() {} constructor() {}
@ -15,7 +17,7 @@ export class NavEngine {
console.log('navigating to', documentId); console.log('navigating to', documentId);
const doc = siteMap.find(d => d.id === documentId); const doc = siteMap.find(d => d.id === documentId);
if (doc) { if (doc) {
this._fetchDoc(doc.url) this.fetchDoc(doc.url)
.then(content => { .then(content => {
console.log('fetched content', content); console.log('fetched content', content);
this.currentDoc = Object.assign({}, doc, {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. // TODO(robwormald): use Http proper once new API is done.
return fetch(url).then(res => res.text()); return fetch(url).then(res => res.text());
} }

View File

@ -1,5 +1,5 @@
import { Directive, HostListener, Input } from '@angular/core'; import { Directive, HostListener, Input } from '@angular/core';
import { NavEngine } from './nav-engine'; import { NavEngine } from './nav-engine.service';
@Directive({ @Directive({
selector: '[aioNavLink]' selector: '[aioNavLink]'

View File

@ -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();
}));
});

View File

@ -1,8 +0,0 @@
import { Injectable } from '@angular/core';
@Injectable()
export class PageManagerService {
constructor() { }
}

View File

@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>(v42) One framework - Angular</title> <title>Angular Docs v.2</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">