JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="myApp" ng-controller="Controller">
<div vvmarquee ng-model="data"></div>
<input type="text" ng-model="data">
</div>
JavaScript
angular.module('myApp', [])
.directive('vvMarquee', function ($parse) {
return {
restrict: 'A',
require: ['?ngModel'],
replace: true,
template: '<marquee/>',
link: function (scope, element, attrs) {
scope.$watch(attrs.ngModel, function (newVal) {
var getter = $parse(attrs.ngModel);
var model = getter(scope);
element.html(model);
});
}
};
});
function Controller($scope) {
$scope.data = "vvakame";
}