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

returning anything from a controller breaks controllerAs (1.4 only) #11683

Closed
purge opened this issue Apr 22, 2015 · 4 comments
Closed

returning anything from a controller breaks controllerAs (1.4 only) #11683

purge opened this issue Apr 22, 2015 · 4 comments

Comments

@purge
Copy link

purge commented Apr 22, 2015

Previously, this was ok but using 1.4-rc.0 the return value causes any bindings in the controller to fail. See https://jsfiddle.net/purge/8vjpgm3h/1/
This is particularly a problem for coffeescript which automatically returns the last statement.

@purge
Copy link
Author

purge commented Apr 22, 2015

Ah, this is to do with #10502 so it is a breaking change and should probably be mentioned in the upgrade guide.

@petebacondarwin
Copy link
Contributor

@purge - I don't see the problem in your fiddle - you are not returning anything from either controller. What you are doing is trying to attach two directives that define a new scope to a single element, which does not work.

@petebacondarwin petebacondarwin modified the milestones: Purgatory, 1.4.0-rc.2 May 5, 2015
@purge
Copy link
Author

purge commented May 6, 2015

@petebacondarwin sorry, for some reason the fiddle has been reset to the one that was forked - see a proper example of the issue here:
https://jsfiddle.net/purge/8vjpgm3h/1/
Thanks

@caitp
Copy link
Contributor

caitp commented May 6, 2015

@purge it's working 100% correctly there. here's a clearer example: https://jsfiddle.net/z65qqtu7/ (https://jsfiddle.net/g46gb9ne/ is an even better one)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants