R.co R.co - 6 months ago 23
AngularJS Question

Change marquee message with select box

I would know if it's possible to change the marquee content message with a selectbox ?

If I choose "Option1" or "Option2" etc..
The marquee has to change the message and display "Option1" or "Option2" etc..

Using AngularJs.

SSH SSH
Answer

try this

var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope,$filter) {
    
    $scope.titles = ["title1","title2"];
});
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
  
  <select ng-model="title" ng-options="title as title for title in titles"></select>
  <marquee>{{title}}</marquee>

  </div>

Comments