Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit c03ccde

Browse files
committed
Jesus' edits
1 parent e1e5997 commit c03ccde

File tree

7 files changed

+25
-16
lines changed

7 files changed

+25
-16
lines changed

public/docs/_examples/cb-jquery-plugin/ts/app/app.component.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// #docregion
2-
import { Component } from '@angular/core';
3-
import { HeroAssignmentComponent } from './hero-assignment.component';
4-
import { HeroComponent } from './hero.component';
2+
import { Component } from '@angular/core';
53

64
@Component({
75
selector: 'my-app',
@@ -17,8 +15,7 @@ import { HeroComponent } from './hero.component';
1715
</div>
1816
</div>
1917
</div>
20-
`,
21-
directives: [HeroAssignmentComponent, HeroComponent]
18+
`
2219
})
2320
export class AppComponent {
2421
heroes = ['Mr. Nice',
@@ -30,7 +27,7 @@ export class AppComponent {
3027
'Rescue village from dragon(s)',
3128
'Rescue princess from tower'];
3229

33-
removeHero(heroToRemove: string) {
30+
removeHero(heroToRemove: string): void {
3431
this.heroes = this.heroes.filter(hero => hero !== heroToRemove);
3532
}
3633
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
4+
import { AppComponent } from './app.component';
5+
import { HeroAssignmentComponent } from './hero-assignment.component';
6+
import { HeroComponent } from './hero.component';
7+
8+
@NgModule({
9+
imports: [ BrowserModule ],
10+
declarations: [ AppComponent, HeroAssignmentComponent, HeroComponent ],
11+
bootstrap: [ AppComponent ]
12+
})
13+
export class AppModule {}

public/docs/_examples/cb-jquery-plugin/ts/app/hero-assignment.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<div #assignment class="assignment" [ngClass]="{selected: heroDropped}">
33
<div>{{title}}</div>
44
<ul>
5-
<li *ngFor="let hero of assignedHeroes">{{hero}}</li>
5+
<li *ngFor="let hero of assignedHeroes">{{hero}}</li>
66
</ul>
77
</div>

public/docs/_examples/cb-jquery-plugin/ts/app/hero-assignment.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class HeroAssignmentComponent implements AfterViewInit {
1414
assignedHeroes: string[] = [];
1515

1616
// #docregion add-plugin
17-
ngAfterViewInit() {
17+
ngAfterViewInit(): void {
1818
jQuery(this.assignment.nativeElement).droppable({drop : (event: any, ui: any) => {
1919
let heroName = ui.draggable.data('hero');
2020
if (this.assignedHeroes.indexOf(heroName) === -1) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- #docregion -->
22
<div #hero class="hero" [attr.data-hero]="name">
33
{{name}}
4-
<div><button (click)="done()">Done</button></div>
4+
<div><button (click)="done()">Done</button></div>
55
</div>

public/docs/_examples/cb-jquery-plugin/ts/app/hero.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ declare var jQuery: any;
1010
})
1111
export class HeroComponent implements AfterViewInit {
1212
@Input() name: string;
13-
@Output() remove: EventEmitter<string> = new EventEmitter<string>();
13+
@Output() remove = new EventEmitter<string>();
1414
@ViewChild('hero') hero: ElementRef;
1515

1616
// #docregion add-plugin
17-
ngAfterViewInit() {
17+
ngAfterViewInit(): void {
1818
jQuery(this.hero.nativeElement).draggable({revert: 'invalid'});
1919
}
2020
// #enddocregion add-plugin
2121

22-
done() {
22+
done(): void {
2323
this.remove.emit(this.name);
2424
}
2525
}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { bootstrap } from '@angular/platform-browser-dynamic';
1+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
22

3-
import { AppComponent } from './app.component';
3+
import { AppModule } from './app.module';
44

5-
bootstrap(AppComponent, [])
6-
.catch((err: any) => console.error(err));
5+
platformBrowserDynamic().bootstrapModule(AppModule);

0 commit comments

Comments
 (0)