Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

directive-start, directive-end syntax is incompatible with ngController. #5724

Closed
sukei opened this issue Jan 10, 2014 · 4 comments
Closed

Comments

@sukei
Copy link

sukei commented Jan 10, 2014

The current implementation doesn't allow the usage of directive-start, directive-end syntax with ngController directive.

Here is a plunkr that shows the issue: http://plnkr.co/edit/gWdNsc?p=preview

@caitp
Copy link
Contributor

caitp commented Jan 10, 2014

That's kind of interesting. I'm not sure if ngController is meant to be used with the -start/-end scheme (which, if my patch lands, will be much more restricted in the future) --- but it is interesting that it only gets applied to the element it's instantiated on, and not all of the collected elements for the directive. I guess the reason for this lives in the controller instantiating stuff here, which only gets applied to the element, and not shared by the collected elements.

Sort of unexpected in comparison with the -start and -end stuff, but as I said, I am hoping -start and -end will be restricted a lot more in the future so that it's clear what the desirable behaviour is.

@gsklee
Copy link
Contributor

gsklee commented Jan 11, 2014

@caitp Can we have a link to the patch you've mentioned?

I think there should be a flag in directive config object that toggle the range apply behavior on/off. This was originally only meant for ngRepeat; making it freely available is like making it free-for-all. This is bound to cause unexpected issues.

@rodyhaddad
Copy link
Contributor

@gsklee #5372 for caitp's patch, needs more +1s :-)

@btford
Copy link
Contributor

btford commented Mar 25, 2014

@sukei do you have a use case for this in mind?

If so, post it below and I'll reopen this for further discussion. Otherwise, I think @caitp's fix looks good.

@btford btford closed this as completed Mar 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants