mvindahl/angular-pan-zoom

Isolate scope design issue

Closed this issue · 3 comments

Working with angular pan zoom is pretty painless, when panning or zooming on a static image.

However....

When panning and zooming on a Canvas or SVG document (linked with a Controller in the parent scope) - it's not the case. It becomes very difficult (well, unintuitive at least) to access an ng-model from the controller in the parent scope.

Here's a suggestion for a solution to the issue:

Remove the isolate scope from the panzoom-directive, and use the $parse-service to read the config- and model-objects from the link-function of the directives attr-attribute. Then put those objects on the scope on a`$panzoom``-property (the name is just a suggestion) to avoid colliding with the parent controller.

I'll gladly provide a plunkr to clarify the issue since I'm uncertain that the description above is "clear and to the point".

Hi Anders,

Thanks for the input. Still trying to grasp the nature of the problem. I'm sure that a plunker would help.

Regards,
/Martin

Never mind, I think I had another issue with my code... what I saw must have been a false positive. My bad.