How do I add an angular variable into my controller function? I want to open links in my mobile app in external browser.
This currently works for me:
html:
<button ng-click="openMenu()">Menu</button>
controller.coffee:
.controller("ShowController", ($scope, City, supersonic) ->
$scope.openMenu = function($scope) {
supersonic.app.openURL(“https://www.google.com“);
};
(The function is in javascript)
However, I need to open my angular variable {{city.menu.url}}, so this is what I placed in the html.
<button ng-click="openMenu(city.menu.url)">Menu</button>
But I don't know how to orient the javascript so that the supersonic.app.openURL opens the variable I specified in the html. Appreciate all answers.
Change this
supersonic.app.openURL(“https://www.google.com“);with:Inject
$windowin the controller