I have read about it in other posts, but I couldn\'t figure it out.
I have an array,
$scope.items = [
{ID: \'000001\', Title: \'Chicago\'},
{ID
In CoffeeScript:
#directive
app.directive('select2', ->
templateUrl: 'partials/select.html'
restrict: 'E'
transclude: 1
replace: 1
scope:
options: '='
model: '='
link: (scope, el, atr)->
el.bind 'change', ->
console.log this.value
scope.model = parseInt(this.value)
console.log scope
scope.$apply()
)
Sometimes it's much easier to create your own directive...