ANGULAR NG-SHOW AND CHANGE TEXT FIELD TO INPUT FIELD

Example code in Angular JS to change the text Heading to input text field without losing 2-way data binding. <!DOCTYPE html><html><script src=”https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js”></script><body><div ng-app=”myApp” ng-controller=”myCtrl”><h1 ng-dblclick=”change()” ng-if=”!myv”>{{carname}}</h1><h1 ng-show=”myv”><input type=”text” ng-model=”carname”><button ng-click=”done()”>Done</button></h1></div><script>var app = angular.module(‘myApp’, []);app.controller(‘myCtrl’, function($scope) { $scope.carname = “Volvo”; $scope.change = function() { $scope.myv = … Continue readingANGULAR NG-SHOW AND CHANGE TEXT FIELD TO INPUT FIELD