Found out that one version of mine already would have worked, but I had the replace: true flag set (example: http://plnkr.co/edit/nhJ3nB9dvCBD1m6fYWNg?p=preview -> try to replace the directive tag). When I replace the div the validation fails. Just in case anybody is running in the same problem and googles this thread...
Am Mittwoch, 3. September 2014 14:59:01 UTC+2 schrieb Anton Trapp: > > Hi! > > As nobody was able (or willing) to answer my question ( > https://groups.google.com/forum/#!topic/angular/W-md4KDG-R4) I tried to > figure out how to get directives with a form working. I read hundrets of > problem reports and the answers (so I think that nobody really gets the > concept of transclude & scopes and it will be changed in 1.3 or later) but > still got no solution. > > Problem: > --> directive ownForm with transclude (controller was here, not working > at all, moved up above the form directive) > -> input elements (should become directives too, but still struggling > with the form directive) > > What I figured out until now (after days of work, everything else in > Angular is just super-easy and can be used without even thinking about it): > > 1) directive with controller in the same tag is not working, so I moved > the controller up to an extra div. > > 2) Scope in transcluded div not available, must clone everything in the > link function otherwise nothing is working. > > 3) When using solution 2 the scope is OK but the form $dirty, $invalid, > ... stuff is not working. > > 4) scope handling in directives with transclude is a pain in the ass and > completely without logic, should have been changed in 1.2, now it is > scheduled for 1.3 > > > > So I think the solution is > > a) not to use AngularJS (I want to use it because 99.99% of the framework > is just toooo good) > > b) to implement everything as plain HTML with jQuery when it comes to > forms and use Angular for everything else (where it is working like a charm) > > c) wait for 1.3 and hope that someone has the time to implement a solution > that is working and can be used as easy as the rest of this awesome > framework > > d) don't use directives with transclude, use copy paste > > I think I will use d) if nobody comes with an idea e) ;) > > Thank you very much in advance! > > Kind regards, > Anton > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
