0

I have the following

<form id="myForm" class="form-inline" >
<div class="container-fluid  ">
<input ng-class="{'requiredError':programNameError}" name="first" ng-model="ProgramDetail.ProgramName" placeholder="Name" class="form-control input-xs" type="text" style="width:70%" />
</div>
</form>

This page is being called by the ngRoute when I navigate to a specific route and I specify the controller in the route configuration, buen when I try to access the $scope.myForm i get undefined.

Am I missing something here?

1
  • Can you show your controller code? Commented Nov 27, 2015 at 15:52

2 Answers 2

3

Give the form a name attribute to expose it on the $scope

<form id="myForm" name="myForm" class="form-inline" >

</form>

From the docs:

If the name attribute is specified, the form controller is published onto the current scope under this name.

Sign up to request clarification or add additional context in comments.

Comments

1

Argh, not enough reputation to write a comment, so writing as an answer.. :(

try defining the attribute name for the form.. I have a similar case and it worked only with this..

<form id="myForm" class="form-inline" name="myForm">
</form>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.