I want to create a simple directive called form-field. The directive is as follow: a grouping of form label, form input, form error text box. My goal is create a directive that can contain all these in one single line.
<form-field label="Username:" regex="^[a-z]{5,7}$" constrainsViolationMessage="username should be between 5 and 7 chars" model="username" place-holder="username"> </form-field>
The problem that I encountered is that I am unable to bind the input variable value to a parent scope variable.
In the fiddle, binding to parent scope does not work at all, on localhost the directive variable is on step after the parent scope variable ! For example if binding variable is 123 parent scope variable is 12.
Here is a fiddle, I hope someone help me with some suggestion .
On local host the problem is that the directive scope is one step after the parent scope the image below depicts the prblem.

Ok, I fixed the problem, take a look at the first comment by stewie. About the second problem , as shown in the picture, it seems that angular.1.0.2 has a bug in it. If you select angular.1.0.2 then try to write something in the box the input box text is one character after the parent scope binding. Switch to angular.1.0.3 or angular.1.0.4 and everything goes well.