Famous / famous-angular

Bring structure to your Famo.us apps with the power of AngularJS. Famo.us/Angular integrates seamlessly with existing Angular and Famo.us apps.
https://famo.us/angular
Mozilla Public License 2.0
1.92k stars 275 forks source link

Angular compileProvider debug info #283

Closed ghaiat closed 9 years ago

ghaiat commented 9 years ago

if you set $compileProvider.debugInfoEnabled(false)in your app config, nothing shows up anymore.

FYI: https://docs.angularjs.org/api/ng/provider/$compileProvider You may want to disable this in production for a significant performance boost. See Disabling Debug Data for more.

graunked commented 9 years ago

It looks like element.scope() requires debug data to be on,, and I know we're using that method at least here: https://github.com/Famous/famous-angular/blob/master/src/scripts/services/famousAnimate.js#L158 and probably other places.

ghaiat commented 9 years ago

Hi @zackbrown Any thoughts on this? i dont think famous-angular should rely on something that can be turned off in the angular config... Cheers

zackbrown commented 9 years ago

Hey @ghaiat —

There are two main places in the lib where there are hard dependencies on element.scope(). One of them is the animation logic, where we use element.scope() to bridge from elements to famo.us components—because when we patch into Angular's animation-event logic we are given references to elements, not scopes.

The other is $famous.find, which is a necessary bridge anytime someone wants to manipulate directly (with javascript) a render tree element that they created declaratively in an HTML template. In that case, by querying the DOM the developer gets access to an element, which we need to bridge to a scope in order to get a handle on the Famo.us component linked to that element.

I agree that it would be nice to be able to support debugInfoEnabled(false), but at the moment we don't, and we won't be able to unless we come up with an alternative solution for getting from element -> scope for these two cases. (if you have any ideas, please share!)

jordanpapaleo commented 9 years ago

Hey @ghaiat

Are there any additional thoughts on this? Thanks - Jordan