JSFiddle - React, Tailwind, and code Playground
by Joe Saad
HTML
<joe-grid></joe-grid>
JavaScript
var app = angular.module('app', []);
app.directive('joeGrid', function() {
return {
restrict: 'E',
template: '<select name="myTables" id="myTables" ng-model="mytable"><option value="table1">table1</option><option value="table2">table2</option><option value="table3">table3</option><option value="table4">table4</option></select><h1>Hi there, it is me: {{adjective}} </h1>',
scope: {
adjective: '@viewedtable',
},
link: function(scope, element, attrs) {
attrs.$set('viewedtable', '{{mytable}}');
// I want to viewtable attribute to be equal to ng-model=mytable
}
}
});
angular.element(document).ready(function() {
angular.bootstrap(document, ["app"])
});