Angular: How to open angular variable in external browser


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:


<button ng-click="openMenu()">Menu</button>

.controller("ShowController", ($scope, City, supersonic) ->
    $scope.openMenu = function($scope) {““);

(The function is in javascript)

However, I need to open my angular variable {{}}, so this is what I placed in the html.

<button ng-click="openMenu(">Menu</button>

But I don’t know how to orient the javascript so that the opens the variable I specified in the html. Appreciate all answers.


You want do a little something like this

#controller in javascript
app.controller("ShowController", function($scope, supersonic){
    $ = {
        menu: { 
            url: ''

    $scope.openMenu = function(urlToOpen){;

<button ng-click="openMenu(">Click here, why not? </button>