-
Notifications
You must be signed in to change notification settings - Fork 877
docs(quickstart): QuickStart reboot #2762
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
- var currentPage = false | ||
- var nextPage = false | ||
- var hideNextPage = false; | ||
|
||
- var data = public.docs[current.path[1]][current.path[2]][current.path[3]]._data | ||
|
||
for page, slug in data | ||
|
||
// CHECK IF CURRENT PAGE IS SET, THEN SET NEXT PAGE | ||
if currentPage | ||
if !nextPage && page.nextable && !page.hide | ||
.l-sub-section | ||
h3 Next Step | ||
a(href="/docs/#{current.path[1]}/#{current.path[2]}/#{current.path[3]}/#{slug}.html") #{page.title} | ||
if !hideNextPage | ||
.l-sub-section | ||
h3 Next Step | ||
a(href="/docs/#{current.path[1]}/#{current.path[2]}/#{current.path[3]}/#{slug}.html") #{page.title} | ||
|
||
//NEXT PAGE HAS NOW BEEN SET | ||
- var nextPage = true | ||
|
||
- hideNextPage = page.hideNextPage | ||
|
||
// SET CURRENT PAGE FLAG WHEN YOU PASS IT | ||
if current.path[4] == slug | ||
- var currentPage = true |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
// #docregion | ||
// #docregion import | ||
import { Component } from '@angular/core'; | ||
// #enddocregion import | ||
|
||
// #docregion metadata | ||
@Component({ | ||
selector: 'my-app', | ||
template: '<h1>Hello Angular!</h1>' | ||
template: `<h1>Hello {{name}}</h1>` | ||
}) | ||
// #enddocregion metadata | ||
// #docregion class | ||
export class AppComponent { } | ||
// #enddocregion class | ||
export class AppComponent { name = 'Angular'; } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
// #docregion | ||
import { NgModule } from '@angular/core'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
|
||
import { AppComponent } from './app.component'; | ||
import { AppComponent } from './app.component'; | ||
|
||
@NgModule({ | ||
imports: [ BrowserModule ], | ||
declarations: [ AppComponent ], | ||
bootstrap: [ AppComponent ] | ||
}) | ||
|
||
export class AppModule { } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
// #docregion | ||
// #docregion import | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
|
||
import { AppModule } from './app.module'; | ||
// #enddocregion import | ||
|
||
const platform = platformBrowserDynamic(); | ||
platform.bootstrapModule(AppModule); | ||
platformBrowserDynamic().bootstrapModule(AppModule); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
<!DOCTYPE html> | ||
<!-- #docregion --> | ||
<html> | ||
<head> | ||
<title>Angular QuickStart</title> | ||
<title>Hello Angular</title> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="styles.css"> | ||
<style> | ||
body {color:#369;font-family: Arial,Helvetica,sans-serif;} | ||
</style> | ||
|
||
<!-- 1. Load libraries --> | ||
<!-- #docregion libraries --> | ||
<!-- Polyfills for older browsers --> | ||
<!-- #docregion polyfills --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ward
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. Thx. |
||
<!-- Polyfill for older browsers --> | ||
<script src="node_modules/core-js/client/shim.min.js"></script> | ||
<!-- #enddocregion polyfills --> | ||
|
||
<script src="node_modules/zone.js/dist/zone.js"></script> | ||
<script src="node_modules/reflect-metadata/Reflect.js"></script> | ||
<script src="node_modules/systemjs/dist/system.src.js"></script> | ||
<!-- #enddocregion libraries --> | ||
|
||
<!-- 2. Configure SystemJS --> | ||
<!-- #docregion systemjs --> | ||
<!-- #docregion autobootstrap--> | ||
<script> window.autoBootstrap = true; </script> | ||
<!-- #enddocregion autobootstrap--> | ||
|
||
<script src="systemjs.config.js"></script> | ||
<script> | ||
System.import('app').catch(function(err){ console.error(err); }); | ||
</script> | ||
<!-- #enddocregion systemjs --> | ||
</head> | ||
|
||
<!-- 3. Display the application --> | ||
<!-- #docregion my-app --> | ||
<body> | ||
<my-app>Loading...</my-app> | ||
<!-- #docregion my-app--> | ||
<my-app>Loading AppComponent content here ...</my-app> | ||
<!-- #enddocregion my-app--> | ||
</body> | ||
<!-- #enddocregion my-app --> | ||
|
||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"description": "QuickStart", | ||
"files": [ | ||
"!**/*.d.ts", | ||
"!**/*.js", | ||
"!**/*.[1].*" | ||
"app/app.component.ts", | ||
"index.html" | ||
], | ||
"open": "app/app.component.ts", | ||
"tags": ["quickstart"] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; // necessary for es6 output in node | ||
|
||
import { browser, element, by } from 'protractor'; | ||
|
||
describe('QuickStart E2E Tests', function () { | ||
|
||
let expectedMsg = 'Hello Angular'; | ||
|
||
beforeEach(function () { | ||
browser.get(''); | ||
}); | ||
|
||
it(`should display: ${expectedMsg}`, function () { | ||
expect(element(by.css('h1')).getText()).toEqual(expectedMsg); | ||
}); | ||
|
||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* tslint:disable:no-unused-variable */ | ||
import { AppComponent } from './app.component'; | ||
|
||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { By } from '@angular/platform-browser'; | ||
import { DebugElement } from '@angular/core'; | ||
|
||
//////// SPECS ///////////// | ||
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"'); | ||
}); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice to have this unit test as a part of the seed! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// #docregion | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'my-app', | ||
template: `<h1>Hello {{name}}</h1>` | ||
}) | ||
export class AppComponent { name = 'Angular'; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe mark There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nah. That serves no real purpose and it distracts. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
// #docregion | ||
import { NgModule } from '@angular/core'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { AppComponent } from './app.component'; | ||
|
||
@NgModule({ | ||
imports: [ BrowserModule ] | ||
imports: [ BrowserModule ], | ||
declarations: [ AppComponent ], | ||
bootstrap: [ AppComponent ] | ||
}) | ||
export class AppModule { } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// #docregion | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
import { AppModule } from './app.module'; | ||
|
||
platformBrowserDynamic().bootstrapModule(AppModule); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html> | ||
<!-- #docregion --> | ||
<html> | ||
<head> | ||
<title>Hello Angular</title> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="styles.css"> | ||
<style> | ||
body {color:#369;font-family: Arial,Helvetica,sans-serif;} | ||
</style> | ||
|
||
<!-- Polyfills for older browsers --> | ||
<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/reflect-metadata/Reflect.js"></script> | ||
<script src="node_modules/systemjs/dist/system.src.js"></script> | ||
<script src="systemjs.config.js"></script> | ||
<script> | ||
System.import('app').catch(function(err){ console.error(err); }); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<!-- #docregion my-app--> | ||
<my-app><!-- content managed by Angular --></my-app> | ||
<!-- #enddocregion my-app--> | ||
</body> | ||
|
||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"description": "QuickStart Setup", | ||
"files": [ | ||
"app/app.component.ts", | ||
"app/app.module.ts", | ||
"app/main.ts", | ||
"index.html" | ||
], | ||
"open": "app/app.component.ts", | ||
"tags": ["quickstart setup"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a bare minimal "Hello world" example it seems superfluous to be concerned about style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True but the counterargument - all samples should have a consistent style - prevailed.