jameslouiz
jameslouiz

Reputation: 394

Passing data from directive to parent scope controller

Ive created a directive which creates a google map on the page and all works fine.

What I want to be able to do is pass the map object back out of the directive into the parent controller so I can use it in my methods etc.

I know i could probably store it on some attribute but it seems wrong. Is there any way I can just pass the the object directly into it so I can use it whenever I like?

Thanks, James

Upvotes: 1

Views: 206

Answers (1)

pdr0
pdr0

Reputation: 124

Create a service first with Google Maps and then create a directive to use it.

Upvotes: 1

Related Questions