Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I have a variable, which I got from a querystring in docA:

docA(mainView)

var cat = getUrlParameter('cat');

I also have an ng-click function in docB that handles different views:

docB(rightDrawer)

<li class="item" ng-click="newDay('Monday')">Monday</li>

$scope.newDay

$scope.newDay= function(day){
    supersonic.ui.layers.push('http://localhost/principal.html?day='+day +'&cat='+cat);
    supersonic.ui.drawers.close('right');
}

I'm trying to pass de var "cat" from docA to $scope.newDay

I tried:

calling $window.cat inside $scope.newDay, but got undefined, I assume it is because I'm trying to get a variable from docA inside a function in docB.

GOAL:

go to:

http://localhost/principal.html?day=Lunes&cat=0

from the "scope.newDay" function using variable "cat" from docA and "day" from [docB]newDay('Monday')

share|improve this question
    
what is this supersonic? – MukulSharma Sep 2 at 0:51
    
It's a framework that helps me build mobile applications. In the code I posted it pushes a view to the main View and closes a sidemenu – HiGonz Sep 2 at 2:27

I suggest you look into directives. Agular isolates scopes. With directives you can inherrit scope.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.