0

For some strange reason, after having worked for a while, AngularJS partial view template (html file) once loaded into an ngView drops the first form control. I discovered this when suddenly getting a $scope.formName is undefined.

Example:

The html partial template page starts off like this

<form name="accountCreationForm" novalidate>
  <div>Enter Account Information</div>
  ...
</form>

then when looking at the page source this is what is there.

<div>Enter Account Information</div>
      ...

As you can see the form element has been completely removed. I've confirmed the controller is loading correctly, the call to load the page from the server is returning the form element and that there is no scope variable with the same name. Other forms on the same page (children and non-children of the first form) stay on the page and work correctly.

And if that wasn't enough, the strangest thing about this is that the only work around I've found is to place a <style type="text/css">...</style> before the form element.

If anyone can understand what I'm saying and has any idea's what is going on please let me know.

Thanks

Phillsta
  • 131
  • 3
  • 5

0 Answers0