angular-docs-cn/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie.service.ts

45 lines
1.0 KiB
TypeScript
Raw Normal View History

import { Injectable } from '@angular/core';
import { IMovie } from './movie';
@Injectable()
export class MovieService {
2016-04-27 14:28:22 -04:00
getMovies(): IMovie[] {
return [
{
2016-04-27 14:28:22 -04:00
hero: 'Celeritas',
imageurl: 'images/hero.png',
movieId: 1,
2016-04-27 14:28:22 -04:00
mpaa: 'pg-13',
releaseDate: '2015-12-19T00:00:00',
title: 'Celeritas Reigns',
price: 12.95,
starRating: 4.925,
approvalRating: .97
},
{
2016-04-27 14:28:22 -04:00
hero: 'Mr. Nice',
imageurl: 'images/villain.png',
movieId: 2,
2016-04-27 14:28:22 -04:00
mpaa: 'pg-13',
releaseDate: '2015-12-18T00:00:00',
title: 'No More Mr. Nice Guy',
price: 14.95,
starRating: 4.6,
approvalRating: .94
},
{
2016-04-27 14:28:22 -04:00
hero: 'Angular',
imageurl: 'images/ng-logo.png',
movieId: 3,
2016-04-27 14:28:22 -04:00
mpaa: 'pg-13',
releaseDate: '2015-12-17T00:00:00',
title: 'Angular to the Rescue',
price: 15.95,
starRating: 4.98,
approvalRating: .9995
}
];
}
}