Skip to content

Commit

Permalink
#84 - changed controllerAs to to match ng1.5 component
Browse files Browse the repository at this point in the history
  • Loading branch information
orizens committed Jan 9, 2016
1 parent fe8d8d8 commit 2ac16c8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/components/now-playing/now-playlist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export default angular.module('now-playlist', [
'angular-sortable-view'
])
.config(config)
.directive(NowPlaylistComponent.controllerAs, () => NowPlaylistComponent)
.directive(NowPlaylistComponent.selector, () => NowPlaylistComponent)
// .directive(NowPlaylistComponent.controllerAs, () => NowPlaylistComponent)
;
/* @ngInject */
function config () {

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import template from './now-playlist.tpl.html';

export let NowPlaylistComponent = {
template,
controllerAs: 'nowPlaylist',
selector: 'nowPlaylist',
controllerAs: '$ctrl',
// or "bindings" to follow ng1.5 "component" factory
scope: {
videos: '=',
Expand Down
20 changes: 10 additions & 10 deletions src/components/now-playing/now-playlist/now-playlist.tpl.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<section class="now-playlist" ng-class="{
'transition-in': nowPlaylist.videos.length,
'slide-down': nowPlaylist.showPlaylistSaver
<section class="now-playlist" ng-class="{
'transition-in': $ctrl.videos.length,
'slide-down': $ctrl.showPlaylistSaver
}">
<ul class="nav nav-list xux-maker xnicer-ux"
sv-root sv-part="nowPlaylist.videos"
sv-on-sort="nowPlaylist.sortVideo($item, $indexTo)"

sv-root sv-part="$ctrl.videos"
sv-on-sort="$ctrl.sortVideo($item, $indexTo)"
>
<li class="now-playlist-track"
ng-class="{ 'active': nowPlaylist.nowPlaying.index === $index}"
ng-repeat="video in nowPlaylist.videos | filter:nowPlaylist.filter"
ng-class="{ 'active': $ctrl.nowPlaying.index === $index}"
ng-repeat="video in $ctrl.videos | filter:$ctrl.filter"
sv-element>
<a class="" title="{{:: video.snippet.title }}"
ng-click="nowPlaylist.selectVideo(video, $index)">
ng-click="$ctrl.selectVideo(video, $index)">
{{ $index + 1 }})
<img class="video-thumb" draggable="false" ng-src="{{:: video.snippet.thumbnails.default.url }}" sv-handle title="Drag to sort">
<span class="video-title">{{:: video.snippet.title }}</span>
<span class="badge badge-info">{{:: video.time }}</span>
<span class="label label-danger ux-maker remove-track" title="Remove From Playlist"
ng-click="nowPlaylist.removeVideo($event, video, $index)"><i class="fa fa-remove"></i></span>
ng-click="$ctrl.removeVideo($event, video, $index)"><i class="fa fa-remove"></i></span>
</a>
</li>
</ul>
Expand Down

0 comments on commit 2ac16c8

Please sign in to comment.