diff --git a/public/docs/_examples/pipes/ts/src/app/app.html b/public/docs/_examples/pipes/ts/src/app/app.html index bcaf614709..efe83db02c 100644 --- a/public/docs/_examples/pipes/ts/src/app/app.html +++ b/public/docs/_examples/pipes/ts/src/app/app.html @@ -12,7 +12,7 @@ -

The hero's birthday is {{ birthday | date:"MM/dd/yy" }} /p> +

The hero's birthday is {{ birthday | date:"MM/dd/yy" }}


diff --git a/public/docs/_examples/pipes/ts/src/app/app.ts b/public/docs/_examples/pipes/ts/src/app/app.ts index 29bf1b84ed..c223b3e0f3 100644 --- a/public/docs/_examples/pipes/ts/src/app/app.ts +++ b/public/docs/_examples/pipes/ts/src/app/app.ts @@ -1,4 +1,4 @@ -import {HeroBirthday as HeroBirthday2} from './hero-birthday.2'; +import {HeroBirthday as HeroBirthday2} from './hero-birthday'; import {PowerBooster} from './power-booster'; import {PowerBoostCalculator} from './power-boost-calculator'; import {HeroListComponent} from './hero-list-component'; diff --git a/public/docs/_examples/pipes/ts/src/app/hero-birthday.2.ts b/public/docs/_examples/pipes/ts/src/app/hero-birthday.ts similarity index 88% rename from public/docs/_examples/pipes/ts/src/app/hero-birthday.2.ts rename to public/docs/_examples/pipes/ts/src/app/hero-birthday.ts index 62a3da08bc..2b8c5360b3 100644 --- a/public/docs/_examples/pipes/ts/src/app/hero-birthday.2.ts +++ b/public/docs/_examples/pipes/ts/src/app/hero-birthday.ts @@ -1,5 +1,5 @@ import {bootstrap, Component} from 'angular2/angular2' -// #docregion hero-birthday2 +// #docregion @Component({ selector: 'hero-birthday', template: ` @@ -13,4 +13,4 @@ export class HeroBirthday { toggle = true; toggleFormat() { this.toggle = !this.toggle; } } -// #enddocregion hero-birthday2 +// #enddocregion diff --git a/public/docs/_examples/pipes/ts/src/index.html b/public/docs/_examples/pipes/ts/src/index.html index 30242dceae..9ee62fad92 100644 --- a/public/docs/_examples/pipes/ts/src/index.html +++ b/public/docs/_examples/pipes/ts/src/index.html @@ -17,7 +17,7 @@

Hero Birthday 1

loading...
- loading ... + loading ... diff --git a/public/docs/_examples/pipes/ts/src/plnkr.config b/public/docs/_examples/pipes/ts/src/plnkr.config index e69de29bb2..2ed4f28391 100644 --- a/public/docs/_examples/pipes/ts/src/plnkr.config +++ b/public/docs/_examples/pipes/ts/src/plnkr.config @@ -0,0 +1,3 @@ +{ + "files":["!**/*.d.ts", "!**/*.js"] +} \ No newline at end of file diff --git a/public/docs/_examples/template-syntax/ts/images/hero.png b/public/docs/_examples/template-syntax/ts/images/hero.png deleted file mode 100644 index b60c3ecc30..0000000000 Binary files a/public/docs/_examples/template-syntax/ts/images/hero.png and /dev/null differ diff --git a/public/docs/_examples/template-syntax/ts/images/ng-logo.png b/public/docs/_examples/template-syntax/ts/images/ng-logo.png deleted file mode 100644 index 7929242740..0000000000 Binary files a/public/docs/_examples/template-syntax/ts/images/ng-logo.png and /dev/null differ diff --git a/public/docs/_examples/template-syntax/ts/images/villain.png b/public/docs/_examples/template-syntax/ts/images/villain.png deleted file mode 100644 index d1e71cf00b..0000000000 Binary files a/public/docs/_examples/template-syntax/ts/images/villain.png and /dev/null differ diff --git a/public/docs/_examples/template-syntax/ts/src/app/app.html b/public/docs/_examples/template-syntax/ts/src/app/app.html index 37bab89d5d..5c404f25e5 100644 --- a/public/docs/_examples/template-syntax/ts/src/app/app.html +++ b/public/docs/_examples/template-syntax/ts/src/app/app.html @@ -18,7 +18,7 @@
- +

The title is {{title}}

@@ -30,7 +30,7 @@
- +
@@ -44,7 +44,7 @@ --> -

@@ -72,7 +72,7 @@ - + @@ -99,7 +99,7 @@ - +
@@ -114,11 +114,11 @@ - - - +
OneTwo
Five-Six
@@ -127,16 +127,16 @@ - +
-
The class is special
-
The class is special
- +
The class is special
+
The class is special
+
The class binding is special
- +
This one is not so special
-
This class binding is special too
+
This class binding is special too
@@ -159,20 +159,20 @@ -
-
-
- +
-
@@ -249,7 +249,7 @@ Moe ??? -
You picked +
You picked @@ -329,7 +329,7 @@
The current hero's name is {{currentHero.firstName}}
-
The null hero's name is {{nullHero?.firstName}}
- diff --git a/public/docs/_examples/template-syntax/ts/src/app/app.ts b/public/docs/_examples/template-syntax/ts/src/app/app.ts index 54418707fb..2840ca58ec 100644 --- a/public/docs/_examples/template-syntax/ts/src/app/app.ts +++ b/public/docs/_examples/template-syntax/ts/src/app/app.ts @@ -1,7 +1,7 @@ // NOT EVERYTHING IS NEEDED BY TEMPLATE-SYNTAX CHAPTER // Much left-over from support for "User Input" chapter such as -// ClickMeComponent, -// KeyUpComponent, KeyUpComponentV2, KeyUpComponentV3, +// ClickMeComponent, +// KeyUpComponent, KeyUpComponentV2, KeyUpComponentV3, // LittleTour, LoopbackComponent, // TODO: purge extraneous material @@ -10,17 +10,17 @@ import {bootstrap, Component, CORE_DIRECTIVES, Input, Output, - Directive, + Directive, ElementRef, EventEmitter, NgForm, FORM_DIRECTIVES } from 'angular2/angular2'; class Hero { public id:number - + constructor( - public firstName:string, - public lastName?:string, + public firstName:string, + public lastName?:string, public birthdate?:Date, public url?:string, public rate:number = 100) { @@ -28,17 +28,17 @@ class Hero { } get fullName() {return `${this.firstName} ${this.lastName}`;} - + static nextId = 1; - + static MockHeroes = [ new Hero( - 'Hercules', - 'Son of Zeus', + 'Hercules', + 'Son of Zeus', new Date(1970, 1, 25), 'http://www.imdb.com/title/tt0065832/', 325), - + new Hero('eenie', 'toe'), new Hero('Meanie', 'Toe'), new Hero('Miny', 'Toe'), @@ -67,7 +67,7 @@ class DecoratorDirective {
Last: {{hero?.lastName}}
Birthdate: {{hero?.birthdate | date:'longDate'}}
-
Rate/hr: {{hero?.rate | currency:'EUR'}}
+
Rate/hr: {{hero?.rate | currency:'EUR'}}
` @@ -76,10 +76,10 @@ class HeroDetailComponent { @Input() hero: Hero; - + @Output() deleted = new EventEmitter(); - + onDelete() { this.deleted.next(this.hero); } @@ -100,7 +100,7 @@ class LittleHeroComponent { }) class ClickMeComponent { onClickMe(){ - alert('You are my hero!') + alert('You are my hero!') } } @@ -122,7 +122,7 @@ class LoopbackComponent { class KeyUpComponent { values=''; onKey(event:KeyboardEvent) { - this.values += (event.target).value + ' | '; + this.values += (event.target).value + ' | '; } } @@ -137,7 +137,7 @@ class KeyUpComponent { class KeyUpComponentV2 { values=''; onKey(value:string) { - this.values += value + ' | '; + this.values += value + ' | '; } } @@ -157,7 +157,7 @@ class KeyUpComponentV3 { selector: 'little-tour', template: `

Little Tour of Heroes

- @@ -167,10 +167,10 @@ class KeyUpComponentV3 { }) class LittleTour { heroes=['Windstorm', 'Bombasto', 'Magneta', 'Tornado']; - + addHero(newHero:string) { - if (newHero) { - this.heroes.push(newHero); + if (newHero) { + this.heroes.push(newHero); newHero = null; // clear the newHero textbox } } @@ -185,25 +185,25 @@ enum Color {Red, Green, Blue}; templateUrl: 'app/app.html', directives: [ CORE_DIRECTIVES, FORM_DIRECTIVES, - ClickMeComponent, - KeyUpComponent, KeyUpComponentV2, KeyUpComponentV3, + ClickMeComponent, + KeyUpComponent, KeyUpComponentV2, KeyUpComponentV3, LittleTour, LoopbackComponent, HeroDetailComponent, LittleHeroComponent ] }) -class AppComponent { +class AppComponent { actionName = 'Go for it'; callFax(value:string) {alert(`Faxing ${value} ...`)} callPhone(value:string) {alert(`Calling ${value} ...`)} canSave = true; - + Color = Color; color = Color.Red; colorToggle() {this.color = (this.color === Color.Red)? Color.Blue : Color.Red} - + currentHero = Hero.MockHeroes[0]; - + getStyles(el:Element){ let styles = window.getComputedStyle(el); let showStyles = {}; @@ -212,58 +212,58 @@ class AppComponent { } return JSON.stringify(showStyles); } - + getVal() {return this.val}; - + heroes = Hero.MockHeroes; - + //heroImageUrl = 'http://www.wpclipart.com/cartoon/people/hero/hero_silhoutte_T.png'; - heroImageUrl = '../../images/hero.png'; - + heroImageUrl = 'images/hero.png'; + //iconUrl = 'https://angular.io/resources/images/logos/standard/shield-large.png'; - iconUrl = '../../images/ng-logo.png'; + iconUrl = 'images/ng-logo.png'; isActive = false; isSpecial = true; isUnchanged = true; - + nullHero:Hero = null; // or undefined - + onCancel(event:KeyboardEvent){ let evtMsg = event ? ' Event target is '+ (event.target).innerHTML : ''; alert('Canceled.'+evtMsg) } - + onClickMe(event:KeyboardEvent){ let evtMsg = event ? ' Event target class is '+ (event.target).className : ''; - alert('Click me.'+evtMsg) + alert('Click me.'+evtMsg) } - + onDeleted(hero:Hero){ alert('Deleted hero: '+ (hero && hero.firstName)) } - + onSave(event:KeyboardEvent){ let evtMsg = event ? ' Event target is '+ (event.target).innerText : ''; alert('Saved.'+evtMsg) } - + onSubmit(form:NgForm){ - let evtMsg = form.valid ? - ' Form value is '+ JSON.stringify(form.value) : + let evtMsg = form.valid ? + ' Form value is '+ JSON.stringify(form.value) : ' Form is invalid'; alert('Form submitted.'+evtMsg) } - + product = { name: 'frimfram', price: 42 }; - + setLastName(lastName:string){ console.log(lastName); this.currentHero.lastName = lastName; } - + setClasses() { return { saveable: this.canSave, // true @@ -271,7 +271,7 @@ class AppComponent { special: this.isSpecial, // true } } - + setStyles() { return { 'font-style': this.canSave ? 'italic' : 'normal', // italic @@ -279,7 +279,7 @@ class AppComponent { 'font-size': this.isSpecial ? 'larger' : 'smaller', // larger } } - + toeChoice(picker:HTMLFieldSetElement){ let choices = picker.children; for (let i=0; i[HTML](#html) >[Interpolation](#interpolation) @@ -39,6 +35,8 @@ a(href='/docs/_examples/template-syntax/ts/src/plnkr.html') Live Example 1 >[Input and Output Properties](#inputs-outputs) >[Template Expression Operators](#expression-ops) + + [Live Example](/docs/_examples/template-syntax/ts/src/plnkr.html) .l-main-section :marked diff --git a/tools/plunker-builder/plunkerBuilder.js b/tools/plunker-builder/plunkerBuilder.js index 2cbe943c52..4643f55a2f 100644 --- a/tools/plunker-builder/plunkerBuilder.js +++ b/tools/plunker-builder/plunkerBuilder.js @@ -78,7 +78,7 @@ function initConfigAndCollectFileNames(configFileName) { return path.join(basePath, fileName); } }); - var defaultExcludes = [ '!**/typings/**','!**/tsconfig.json', '!**/plnkr.html', '!**/*.plnkr.html' ]; + var defaultExcludes = [ '!**/node_modules/**','!**/typings/**','!**/tsconfig.json', '!**/plnkr.html', '!**/*.plnkr.html' ]; Array.prototype.push.apply(gpaths, defaultExcludes); config.fileNames = globule.find(gpaths);