plotly directive
by Aswin Devarajan
HTML
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<input type="text" test-dir testOption="data" value>
<test-dir testOptions></test-dir>
JavaScript
var app = angular.module('myApp', []);
app.controller('mainCtrl', ['$scope', function($scope) {
$scope.test = 'viva';
}]);
app.directive('testDir', function() {
return {
scope: {
testOption: '@testOption'
},
require: '?^ngModel',
restrict: 'A',
link: function(scope, elem, attrs, ngModel) {
elem.bind('blur change keyup', function(){
console.log('logging value: ',ngModel.$viewValue);
});
}
};
});