Ângelo Rigo
Ângelo Rigo

Reputation: 2165

Angularjs generating link inside controller

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?

Upvotes: 1

Views: 205

Answers (2)

Pankaj Parkar
Pankaj Parkar

Reputation: 136134

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>

Upvotes: 1

chfumero
chfumero

Reputation: 1147

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>

Upvotes: 1

Related Questions