1

I need to process some parameters inside a controller and generate a link to a template. I cannot figure out how I try to pass assign {{url}}

<button class="button" onclick="window.open('{{url}}', '_system', 'location=yes'); return false;">open</button>

http://www.someurl.com/someservice.php?param=param&anotherparam=another

How can it be done?

2 Answers 2

1

You should use ng-click without interpolation {{}} in it.

Markup

<button class="button" type="button" ng-click="window.open(url, '_system', 'location=yes'); return false;">
   open
</button>
Sign up to request clarification or add additional context in comments.

Comments

1

You can't call angular code inside js onclick. you must use ng-click instead.

<button class="button" ng-click="window.open('{{url}}', '_system', 'location=yes'); return false;">open</button>

1 Comment

can i detect the current platform into the template to show one button to android and ios and another to windowsphone? using ionic.Platform.device() ?

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.