mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-24 02:30:13 +00:00
Update Angular 2 Music Store sample to latest Angular 2 and other dependencies. Switch from asp-ng2-prerender-module to the more general asp-prerender-module.
This commit is contained in:
@@ -5,17 +5,15 @@ import { AlbumDetails } from '../album-details/album-details';
|
||||
import { AlbumEdit } from '../album-edit/album-edit';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'admin-home'
|
||||
selector: 'admin-home',
|
||||
templateUrl: './ng-app/components/admin/admin-home/admin-home.html',
|
||||
directives: [router.ROUTER_DIRECTIVES]
|
||||
})
|
||||
@router.RouteConfig([
|
||||
{ path: 'albums', name: 'Albums', component: AlbumsList },
|
||||
{ path: 'album/details/:albumId', name: 'AlbumDetails', component: AlbumDetails },
|
||||
{ path: 'album/edit/:albumId', name: 'AlbumEdit', component: AlbumEdit }
|
||||
])
|
||||
@ng.View({
|
||||
templateUrl: './ng-app/components/admin/admin-home/admin-home.html',
|
||||
directives: [router.ROUTER_DIRECTIVES]
|
||||
})
|
||||
export class AdminHome {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@ import * as ng from 'angular2/core';
|
||||
import * as models from '../../../models/models';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'album-delete-prompt'
|
||||
})
|
||||
@ng.View({
|
||||
selector: 'album-delete-prompt',
|
||||
templateUrl: './ng-app/components/admin/album-delete-prompt/album-delete-prompt.html'
|
||||
})
|
||||
export class AlbumDeletePrompt {
|
||||
|
||||
@@ -5,9 +5,7 @@ import { Http, HTTP_BINDINGS } from 'angular2/http';
|
||||
import { AlbumDeletePrompt } from '../album-delete-prompt/album-delete-prompt';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'album-details'
|
||||
})
|
||||
@ng.View({
|
||||
selector: 'album-details',
|
||||
templateUrl: './ng-app/components/admin/album-details/album-details.html',
|
||||
directives: [router.ROUTER_DIRECTIVES, AlbumDeletePrompt]
|
||||
})
|
||||
|
||||
@@ -9,9 +9,7 @@ import { FormField } from '../form-field/form-field';
|
||||
import * as AspNet from 'angular2-aspnet';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'album-edit'
|
||||
})
|
||||
@ng.View({
|
||||
selector: 'album-edit',
|
||||
templateUrl: './ng-app/components/admin/album-edit/album-edit.html',
|
||||
directives: [router.ROUTER_DIRECTIVES, AlbumDeletePrompt, FormField, FORM_DIRECTIVES]
|
||||
})
|
||||
|
||||
@@ -5,9 +5,7 @@ import * as models from '../../../models/models';
|
||||
import { AlbumDeletePrompt } from '../album-delete-prompt/album-delete-prompt';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'albums-list'
|
||||
})
|
||||
@ng.View({
|
||||
selector: 'albums-list',
|
||||
templateUrl: './ng-app/components/admin/albums-list/albums-list.html',
|
||||
directives: [router.ROUTER_DIRECTIVES, AlbumDeletePrompt]
|
||||
})
|
||||
|
||||
@@ -3,9 +3,7 @@ import { AbstractControl } from 'angular2/common';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'form-field',
|
||||
properties: ['label', 'validate']
|
||||
})
|
||||
@ng.View({
|
||||
properties: ['label', 'validate'],
|
||||
templateUrl: './ng-app/components/admin/form-field/form-field.html'
|
||||
})
|
||||
export class FormField {
|
||||
|
||||
@@ -9,7 +9,10 @@ import { AdminHome } from '../admin/admin-home/admin-home';
|
||||
import * as models from '../../models/models';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'app'
|
||||
selector: 'app',
|
||||
templateUrl: './ng-app/components/app/app.html',
|
||||
styleUrls: ['./ng-app/components/app/app.css'],
|
||||
directives: [router.ROUTER_DIRECTIVES]
|
||||
})
|
||||
@router.RouteConfig([
|
||||
{ path: '/', component: Home, name: 'Home' },
|
||||
@@ -18,11 +21,6 @@ import * as models from '../../models/models';
|
||||
{ path: '/genres', component: GenresList, name: 'GenresList' },
|
||||
{ path: '/admin/...', component: AdminHome, name: 'Admin' }
|
||||
])
|
||||
@ng.View({
|
||||
templateUrl: './ng-app/components/app/app.html',
|
||||
styleUrls: ['./ng-app/components/app/app.css'],
|
||||
directives: [router.ROUTER_DIRECTIVES]
|
||||
})
|
||||
export class App {
|
||||
public genres: models.Genre[];
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import { bootstrap } from 'angular2/platform/browser';
|
||||
import { FormBuilder } from 'angular2/common';
|
||||
import * as router from 'angular2/router';
|
||||
import { Http, HTTP_PROVIDERS } from 'angular2/http';
|
||||
import { CACHE_PRIMED_HTTP_PROVIDERS } from 'angular2-aspnet';
|
||||
import { App } from './app';
|
||||
|
||||
bootstrap(App, [router.ROUTER_BINDINGS, HTTP_PROVIDERS, CACHE_PRIMED_HTTP_PROVIDERS, FormBuilder]);
|
||||
@@ -4,9 +4,7 @@ import { Http } from 'angular2/http';
|
||||
import * as models from '../../../models/models';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'album-details'
|
||||
})
|
||||
@ng.View({
|
||||
selector: 'album-details',
|
||||
templateUrl: './ng-app/components/public/album-details/album-details.html'
|
||||
})
|
||||
export class AlbumDetails {
|
||||
|
||||
@@ -4,9 +4,7 @@ import * as models from '../../../models/models';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'album-tile',
|
||||
properties: ['albumData']
|
||||
})
|
||||
@ng.View({
|
||||
properties: ['albumData'],
|
||||
templateUrl: './ng-app/components/public/album-tile/album-tile.html',
|
||||
directives: [router.ROUTER_DIRECTIVES]
|
||||
})
|
||||
|
||||
@@ -5,9 +5,7 @@ import * as models from '../../../models/models';
|
||||
import { AlbumTile } from '../album-tile/album-tile';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'genre-contents'
|
||||
})
|
||||
@ng.View({
|
||||
selector: 'genre-contents',
|
||||
templateUrl: './ng-app/components/public/genre-contents/genre-contents.html',
|
||||
directives: [AlbumTile]
|
||||
})
|
||||
|
||||
@@ -4,9 +4,7 @@ import { Http } from 'angular2/http';
|
||||
import * as models from '../../../models/models';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'genres-list'
|
||||
})
|
||||
@ng.View({
|
||||
selector: 'genres-list',
|
||||
templateUrl: './ng-app/components/public/genres-list/genres-list.html',
|
||||
directives: [router.ROUTER_DIRECTIVES]
|
||||
})
|
||||
|
||||
@@ -4,9 +4,7 @@ import { AlbumTile } from '../album-tile/album-tile';
|
||||
import * as models from '../../../models/models';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'home'
|
||||
})
|
||||
@ng.View({
|
||||
selector: 'home',
|
||||
templateUrl: './ng-app/components/public/home/home.html',
|
||||
directives: [AlbumTile]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user