Please, I have this block of code and I'm at a loss on how to add an edit event and button. Any help please?
<script>
var firstApp = angular.module('firstApp', []);
firstApp.controller('FirstController', function($scope) {
$scope.toic = '';
$scope.discussion = '';
$scope.updateMessage = function() {
$scope.heading = $scope.topic;
$scope.body = $scope.discussion;
};
});
</script>
<input ng-model="topic">
<input ng-model="discussion">
<button ng-click="updateMessage()">click<button>
<div>
{{heading}}
{{Body}}
</div>
ng-apporng-controllerattributes, so no bindings will happen. Try wrapping your inputs and your div with<div ng-app="firstApp" ng-controller="FirstController">$scope.toicwill not be displayed in your input being bound totopicas they are not spelled the same