0

This is the sample code I have:

<a ng-click="$parent.infoLinkClickHandler('hard-param', car.engineSize)">{{ car.engineSize }}</a></li>

And in the handler:

$scope.infoLinkClickHandler = function(param1, param2) {
// do something here
        };

param1, the hard-coded parameter is there

param2, is undefined

On the markup, {{ car.engineSize }} prints as expected.

Any ideas?

Thanks!

1 Answer 1

1

It would seem that the scope inside the attribute ng-click is different to that inside the {{}}.

Is the HTML shown the exact HTML, or have you simplified it for the question?

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, that's exactly what it is. Question is way over-simplified from the real situation. I'm using multiple directives within directives (google maps), and things got lost in all the scopes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.