javascript - AngularJs Beginner, how to call a function -
i'm using first time angularjs. want make year scrollbar 1960 2010. need recover value of ng-bind, in order call function updatedata(year) when move scrollbar. have problem...
i guess script uncorrect. can me?
<div ng-app> <input id='slider' type='range' min=1960 max=2010 ng-model='year' width=200> <span ng-bind='year'></span> <script> updatedata({{year}}) </script> <div id='' class='rchart datamaps'></div> </div>
html :
<div ng-app="myapp" ng-controller="personctrl"> <input id='slider' type='range' min=1960 max=2010 ng-model='year' width=200> <div> {{updatedata()}} </div> </div>
js :
var app = angular.module('myapp', []); app.controller('personctrl', function($scope) { $scope.year = "2000"; $scope.updatedata = function() { return "year : "+$scope.year; } });
Comments
Post a Comment