Question

I am trying to use angular to open an popup window in my case.

I have something like

 <a ng-href = "window.open('{{videoLink}}')" >open a video</a>

It gave me 'Not found' error in browser.

However, this will open a video but it's in another tab in browser.

 <a ng-href = {{videoLink}}>open a video</a>

How do I open my video successfully in popup.

Thanks!

Was it helpful?

Solution

Use ng-click like in your previous question.

Your problem was that ng-click takes an AngularJS expression. See: https://docs.angularjs.org/guide/expression

"If you want to run more complex JavaScript code, you should make it a controller method and call the method from your view."

So just set a function in the $scope of the controller for that element and call it through ng-click="clickHander()".

If this doesn't help, you need to post more code (preferably in JSFiddle or something like).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top