I'm stuck with this for the whole day.
<table>
<tr ng-repeat="x in usernames">
<td>{{x.username}}</td>
<td>
<button type='button' ng-click='sendMessage()'>Send Message</button>
</td>
<td>
<button type="button" ng-click="deleteUser()">Delete User</button>
</td>
</tr>
</table>
When I press "Send Message", controller is ignited successfully.
$scope.sendMessage = function () {
$scope.content_in = '<form novalidate>'
+'<label>Message:  </label> <input type="text" ng-model="message"/><br><br>'
+'<button id="mybutton" style="width:75px" ng-click="send()">Send</button>'
+'<input id="mycancel" style="width:75px" type="reset" value="Cancel"/>'
+'</form>';
}
I'm simply trying to update my page with a message form which will be placed in content_in variable. But the changes are not reflected in the view.
I also included:
$scope.$watch('content_in', function () {
alert('hey, content_in has changed!');
});
in the controller, and I'm confident that the changes are made in controller. How can I make the view reflect the changes?
content_inin your HTML. Please provide some relevant markup or, it would be the best, a jsFiddle or plunker. Thx!ngShowngIforngBindHtmlinstead?