Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy AngularJS Tutorial</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script> </head> <body> <form ng-app="myApp" name="Form" ng-controller="rangeCtrl"> <h3>input[range] directive example in AngularJS</h3> <h4>Range input with html min and max Attribute</h4> Model as range: <input type="range" name="range" ng-model="value" min="{{min}}" max="{{max}}" ><br/> <h4>Range input with ng-min and ng-max Attribute</h4> Model as range: <input type="range" name="range" ng-model="value" ng-min="min" ng-max="max" ><br/><br/> Model as number: <input type="number" ng-model="value"><br/><br/> Min: <input type="number" ng-model="min"><br/><br/> Max: <input type="number" ng-model="max"><br> <p> value = {{value}}</p> <p>Form.range.$valid = {{Form.range.$valid}}</p> <p> Form.range.$error = {{Form.range.$error}}</p> </form> <script> var app=angular.module('myApp', []); app.controller('rangeCtrl', function($scope) { $scope.value = 75; $scope.min = 5; $scope.max = 100; }); </script> </body> </html>
www.wikitechy.com © Copyright 2016. All Rights Reserved.