Some main.ts refactoring
This commit is contained in:
parent
7ae51676a2
commit
6a0d192aba
8 changed files with 172 additions and 98 deletions
|
|
@ -58,6 +58,12 @@ export class MediaTypeManager {
|
|||
return replaceTags(template, mediaTypeModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes an object and a MediaType and turns the object into an instance of a MediaTypeModel corresponding to the MediaType passed in.
|
||||
*
|
||||
* @param obj
|
||||
* @param mediaType
|
||||
*/
|
||||
createMediaTypeModelFromMediaType(obj: any, mediaType: MediaType): MediaTypeModel {
|
||||
if (mediaType === MediaType.Movie) {
|
||||
return new MovieModel(obj);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue