Advertisement
Guest User

Untitled

a guest
Jan 6th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function () {
  2.     'use strict';
  3.  
  4.     angular
  5.         .module('directives.selectBox', [])
  6.         .directive('selectBox', selectBox);    
  7.    
  8.     function selectBox() {
  9.         return {
  10.             restrict   : 'E',
  11.             require    : ['ngModel', 'selectBox'],
  12.             scope      : {
  13.                 list     : '=',
  14.                 formCtrl : '='
  15.             },
  16.             replace     : true,
  17.             templateUrl : 'common/directives/selectBox/selectBox.html',
  18.             link: link,
  19.             controller :  SelectBoxController,
  20.             controllerAs: 'vm',
  21.             bindToController: true
  22.         };
  23.        
  24.         function link (scope, element, attrs, controllers){
  25.            
  26.         }
  27.     }
  28.    
  29.     function SelectBoxController(scope) {
  30.  
  31.         var vm = this;
  32.                
  33.         vm.select   = select;
  34.         vm.selected = null;
  35.        
  36.         //////////////////////
  37.        
  38.         function select(item){
  39.             vm.selected = item;
  40.         }
  41.        
  42.     }
  43.  
  44. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement