JSFiddle - React, Tailwind, and code Playground
by wittwerj
HTML
<script src="http://code.angularjs.org/1.2.9/angular.js"></script>
<div ng-controller="MyCtrl">
<select ng-model="selectedOption">
<option ng-repeat="option in options" ng-bind="option.value"></option>
</select>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
myApp.directive('select', function($compile) {
return {
restrict: 'E',
link: function(scope, element, attrs) {
var custom = angular.element('<section>\
<ol>\
<li ng-repeat="option in options" ng-bind="option.value">\
</ol>\
</section>');
custom.insertAfter(element);
$compile(custom)(scope);
}
};
});
function MyCtrl($scope) {
$scope.options = [
{ value: 'bar' },
{ value: 'foo' }
];
$scope.selectedOption = $scope.options[1];
}