scope1

by leozcx

HTML

<div ng-controller="EditController">
  <span>{{message}}</span>
  <div ng-if="show">
    <span>Edit Message</span>
    <input ng-model="message" />
  </div>
</div>

JavaScript

var myApp = angular.module('demo', []);
myApp.controller('EditController', function($scope) {
  $scope.message = "hi there";
  $scope.show = true;
})