Skip to content

Commit

Permalink
Place FormController instance on MainController
Browse files Browse the repository at this point in the history
The use of ng-if creates a child scope, so the form directive creates
the FormController on this scope. $parent is used explicitly to ensure
the FormController is on the correct scope.

Fixes #4
  • Loading branch information
Brandon Tilley committed Mar 4, 2014
1 parent ecab618 commit 72b037c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/css/angello.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ body {
cursor: pointer;
}

input.ng-invalid {
form.ng-dirty input.ng-invalid {
border: 1px solid #B02B2C;
}

input.ng-valid {
form.ng-dirty input.ng-valid {
border: 1px solid #6BBA70;
}

Expand Down Expand Up @@ -152,4 +152,4 @@ input.ng-valid {
height: 100%;
font-size: 14px;
line-height: 1.2em;
}
}
2 changes: 1 addition & 1 deletion app/partials/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3>{{story.title}}</h3>
<div ng-if="detailsVisible" class="my-fade-animation">
<h3>Card Details</h3>

<form name="detailsForm" novalidate>
<form name="$parent.detailsForm" novalidate>
<div class="control-group">
<div class="controls">
<label class="control-label" for="inputTitle">*Title</label>
Expand Down

0 comments on commit 72b037c

Please sign in to comment.