input type number restrict negative values entering
<input type="number" min=0 oninput="validity.valid || (value='');" required>
["2","4"["2","4","7"],"7"]
angular.module('switchdemo', []).controller('DemoController', function($scope){
$scope.init = function(){
$scope.status = true;
}
$scope.changeStatus = function(){
$scope.status = !$scope.status;
}
})
body ng-app="switchdemo">
<h1>On Off switch using Angular JS</h1>
<div ng-controller="DemoController" ng-init="init()">
<div class="well">
<i class="fa fa-toggle-on active"
ng-if="status == true"
ng-click="changeStatus();">
</i>
<i class="fa fa-toggle-on fa-rotate-180 inactive"
ng-if="status == false"
ng-click="changeStatus();">
</i>
</div>
<pre>{{ status }}</pre>
</div>
</body>
.active, .inactive {font-size:40px;cursor:pointer;}
.active, .inactive {font-size:40px;cursor:pointer;}
i.active { color: #5cb85c}
i.inactive {color: #d9534f}
var currentLocation = window.location;
<protocol>//<hostname>:<port>/<pathname><search><hash>

www.stackoverflow.com. A server provides services using the name of the host./index.html.Content-Type header of application/json. The only way to set this header is via Ajax, and Ajax requests are limited to the same domain.ajaxPrefilter, which lets you provide a callback to be invoked every Ajax request. You can pass a CSRF token to the client side via, say, a meta tag. Then set a header using ajaxPrefilter.var CSRF_HEADER = 'X-CSRF-Token';
var setCSRFToken = function(securityToken) {
jQuery.ajaxPrefilter(function(options, _, xhr) {
if ( !xhr.crossDomain )
xhr.setRequestHeader(CSRF_HEADER, securityToken);
});
};
setCSRFToken($('meta[name="csrf-token"]').attr('content'));