Update to Angular 2 Beta 1. New bug: no longer waits for server-side HTTP requests to complete - waiting for info to resolve this.

This commit is contained in:
SteveSandersonMS
2016-01-25 15:13:30 +00:00
parent f44b84f2ab
commit 381b7b884e
32 changed files with 113 additions and 100 deletions

View File

@@ -1,4 +1,4 @@
<div *ng-if="albumData">
<div *ngIf="albumData">
<h2>{{ albumData.Title }}</h2>
<p>

View File

@@ -1,5 +1,6 @@
import * as ng from 'angular2/angular2';
import * as ng from 'angular2/core';
import * as router from 'angular2/router';
import { NgIf } from 'angular2/common';
import { Http } from 'angular2/http';
import * as models from '../../../models/models';
@@ -8,7 +9,7 @@ import * as models from '../../../models/models';
})
@ng.View({
templateUrl: './ng-app/components/public/album-details/album-details.html',
directives: [ng.NgIf]
directives: [NgIf]
})
export class AlbumDetails {
public albumData: models.Album;

View File

@@ -1,4 +1,4 @@
<a [router-link]="['/Album', { albumId: albumData.AlbumId }]">
<a [routerLink]="['/Album', { albumId: albumData.AlbumId }]">
<img alt="{{ albumData.Title }}" src="{{ albumData.AlbumArtUrl }}">
<h4>{{ albumData.Title }}</h4>
</a>

View File

@@ -1,10 +1,10 @@
import * as ng from 'angular2/angular2';
import * as ng from 'angular2/core';
import * as router from 'angular2/router';
import * as models from '../../../models/models';
@ng.Component({
selector: 'album-tile',
properties: ['albumData: albumdata']
properties: ['albumData']
})
@ng.View({
templateUrl: './ng-app/components/public/album-tile/album-tile.html',

View File

@@ -1,7 +1,7 @@
<h3>Albums</h3>
<ul class="list-unstyled">
<li *ng-for="#album of albums" class="col-lg-2 col-md-2 col-sm-2 col-xs-4 container">
<li *ngFor="#album of albums" class="col-lg-2 col-md-2 col-sm-2 col-xs-4 container">
<album-tile [albumData]="album"></album-tile>
</li>
</ul>

View File

@@ -1,5 +1,6 @@
import * as ng from 'angular2/angular2';
import * as ng from 'angular2/core';
import * as router from 'angular2/router';
import { NgFor } from 'angular2/common';
import { Http } from 'angular2/http';
import * as models from '../../../models/models';
import { AlbumTile } from '../album-tile/album-tile';
@@ -9,7 +10,7 @@ import { AlbumTile } from '../album-tile/album-tile';
})
@ng.View({
templateUrl: './ng-app/components/public/genre-contents/genre-contents.html',
directives: [ng.NgFor, AlbumTile]
directives: [NgFor, AlbumTile]
})
export class GenreContents {
public albums: models.Album[];

View File

@@ -1,12 +1,12 @@
<h3>Browse Genres</h3>
<p *ng-if="genres">
<p *ngIf="genres">
Select from {{ genres.length }} genres:
</p>
<ul class="list-group">
<li *ng-for="#genre of genres" class="list-group-item">
<a title="{{genre.Description}}" [router-link]="['/Genre', { genreId: genre.GenreId }]">
<li *ngFor="#genre of genres" class="list-group-item">
<a title="{{genre.Description}}" [routerLink]="['/Genre', { genreId: genre.GenreId }]">
{{ genre.Name }}
</a>
</li>

View File

@@ -1,5 +1,6 @@
import * as ng from 'angular2/angular2';
import * as ng from 'angular2/core';
import * as router from 'angular2/router';
import { NgIf, NgFor } from 'angular2/common';
import { Http } from 'angular2/http';
import * as models from '../../../models/models';
@@ -8,7 +9,7 @@ import * as models from '../../../models/models';
})
@ng.View({
templateUrl: './ng-app/components/public/genres-list/genres-list.html',
directives: [router.ROUTER_DIRECTIVES, ng.NgIf, ng.NgFor]
directives: [router.ROUTER_DIRECTIVES, NgIf, NgFor]
})
export class GenresList {
public genres: models.Genre[];

View File

@@ -4,7 +4,7 @@
</div>
<ul class="row list-unstyled" id="album-list">
<li *ng-for="#album of mostPopular" class="col-lg-2 col-md-2 col-sm-2 col-xs-4 container">
<li *ngFor="#album of mostPopular" class="col-lg-2 col-md-2 col-sm-2 col-xs-4 container">
<album-tile [albumData]="album"></album-tile>
</li>
</ul>

View File

@@ -1,5 +1,6 @@
import * as ng from 'angular2/angular2';
import * as ng from 'angular2/core';
import { Http } from 'angular2/http';
import { NgFor } from 'angular2/common';
import { AlbumTile } from '../album-tile/album-tile';
import * as models from '../../../models/models';
@@ -8,7 +9,7 @@ import * as models from '../../../models/models';
})
@ng.View({
templateUrl: './ng-app/components/public/home/home.html',
directives: [ng.NgFor, AlbumTile]
directives: [NgFor, AlbumTile]
})
export class Home {
public mostPopular: models.Album[];