Saturday, 16 January 2016

How to bind a ng-model with input type, Get and Set value from/to input type

Use of ng-model:ng-model is used with input to get and set value.
<div ng-controller="angularjsexampleCtlr" class="col-lg-12">
        <div class="col-lg-6">
            Get and Set Value form/in input
        <div class="col-lg-6">
            <input type="text" ng-model="value"><input>
            <button ng-click="myfun()">Show Value</button>

o/p:     selectedValue= {{value}}

    angular.module('webapp', []).controller('angularjsexampleCtlr', function ($scope, $http) {
            alert("Value : "+$scope.value);

Get and Set Value form/in input
o/p: value = {{value}}

No comments :

Post a comment