Advertisement
Guest User

Untitled

a guest
Jul 12th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ////
  2. src/app/playlist/playlist.component.ts
  3. ////
  4.  
  5. import { Component, OnInit } from '@angular/core';
  6. import { PlaylistService } from '../playlist.service';
  7.  
  8. @Component({
  9.   moduleId: module.id,
  10.   selector: 'app-playlist',
  11.   templateUrl: './playlist.component.html',
  12.   styleUrls: ['./playlist.component.css']
  13. })
  14.  
  15. // Component class
  16. export class PlaylistComponent implements OnInit {
  17.  
  18.   playlists: any[];
  19.  
  20.   constructor(private _playlistService: PlaylistService) { }
  21.  
  22.   ngOnInit() { this.getPlaylists() }
  23.  
  24.   getPlaylists() {
  25.     this._playlistService.getPlaylists()
  26.       .subscribe(
  27.         playlists => this.playlists = playlists
  28.       );
  29.   }
  30. }
  31.  
  32. ////
  33. src/app/playlist/playlist.component.html
  34. ////
  35.  
  36. <tr *ngFor="let asset of playlists.playlist_assets">
  37.                   <td>
  38.                     <img class="img-rounded" src="assets/images/placeholder-200x150.png" alt="" height="50">
  39.                   </td>
  40.                   <td>{{asset.id}}</td>
  41.                   <td>{{asset.asset.name}}</td>
  42.                   <td>{{asset.asset.content_type}}</td>
  43.                   <td>{{asset.duration}}s</td>
  44.                   <td>{{asset.asset.template_type}}</td>
  45.                   <td>{{asset.asset.subtype}}</td>
  46.                   <td>{{asset.banner}}</td>
  47.                   <td>
  48.                     <div class="checkbox checkbox-primary">
  49.                       <input id="checkbox1" type="checkbox">
  50.                       <label for="checkbox1"></label>
  51.                     </div>
  52.                   </td>
  53.                 </tr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement