johannesjo / ng-fab-form

Convenient forms for Angular with no extra markup? Fabulous!
https://johannesjo.github.io/ng-fab-form
MIT License
172 stars 25 forks source link

Does not work with dynamic data #51

Closed tushar-borole closed 9 years ago

tushar-borole commented 9 years ago

Suppose i dynamically add element by javascript;

i cant see validation error here is code snipped

/@description:to upload video to aws and execute the function/ app.directive('select, function ($parse,$compile) { return { link: function (scope, elm, attr, ngModelCtrl) {

        var html = "<input type='text' class='uiselectclass' ng-model=" + attr.ngModel + " required/>"
        var angualarHtml = $compile(html)(scope);
        elm.after(angualarHtml)
    }
};

});

johannesjo commented 9 years ago

Thanks for reporting! Can you actually see the standard classes like ng-invalid and the like on the element?

Also it needs to be wrapped in a form to work.

tushar-borole commented 9 years ago

Yes i can see, but i am not able to see the error template appending to dom

johannesjo commented 9 years ago

Thank you. I'll dig into that. Could you by any chance provide a plunkr? That would be most helpful! :)

johannesjo commented 9 years ago

Works for me. You probably shouldn't use select as a name for a directive like that. Might also be you're not using the latest version of ng-fab-form.

tushar-borole commented 9 years ago

Yeh may be version problem http://plnkr.co/edit/WPwKs70UXwARg6SctDQU?p=preview Thanks

johannesjo commented 9 years ago

If you have a problem like this, you might also wanna try the waitForFormCtrl option.

tushar-borole commented 9 years ago

Thanx a lot man;

johannesjo commented 9 years ago

You're welcome!