(function () { 'use strict'; var streamApp = angular.module('streamApp'); streamApp.directive('albumCrudDirective', ['albumsService', AlbumCrudDirective]); function AlbumCrudDirective(albumsService) { return { restrict: 'E', scope: { callback: '=', show: '=', }, templateUrl: '/App/Directives/basicCrudDirective.html?v=6.0.0c', link: function (scope, element, attrs, tabsCtrl) { scope.submitNew = function () { albumsService.add(scope.toAdd).then(() => scope.callback()); scope.cancelNew(); }; scope.placeholder = "Album Name"; scope.cancelNew = function () { scope.show = false; scope.toAdd = ''; }; scope.$watch('ngShow', function () { setTimeout(function () { $('#tagname').focus(); }, 100); }); } }; }; })();