I am facing an issue with my html template, where a reusable modal is included using ng-included like this:
myPartial.html
... SOME HTML ...
<ng-include src="'form.html'"></ng-include>
modal.html
...
<form>
<input ng-model="comment.value" />
<button type="submit" ng-click="save(comment.value)" />
</form>
...
I am trying to figure out the best way to clear the form, especially from the controller. I want to clear the form within my save()
method after a successful http call, but due to ng-include creating its own scope, I am unsure how to achieve this.
You can see the problem in action on this plunker: http://plnkr.co/edit/zkxZOZr3f7sHJZfCiuoT?p=preview
If you directly place the contents of form.html into index.html, it works as expected.