Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hello,
I know that I can navigate to other view with button event.
But I need to create a function which change view only if something happen.
So how can I change view with a JavaScript?
Thanks for every answer.
Tomas
Solved! Go to Solution.
make a new view 'prova'
and make a script :
$scope.go=function() {
twx.app.fn.navigate("prova");
};
assign go to click event
Giuseppe
$scope.app.fn.navigate('Enter View Name Here'); //navigate to other View
make a new view 'prova'
and make a script :
$scope.go=function() {
twx.app.fn.navigate("prova");
};
assign go to click event
Giuseppe
Hi,
I am having issues trying to replicate this behavior and was wondering if you can see what I'm doing wrong? I am working on Hololens but I don't believe this should affect anything.
I have 2 'views', the first is 'Home' (The name, Studio ID and friendly name are all the same) and the second 'H&S' (again the name, Studio ID and friendly name are all the same)
In the Home.js I have:
$scope.go=function() { twx.app.fn.navigate("H&S"); };
On the swipe right application event (I have tried on a click event as well) I call the function:
go();
But the scene does not change in the preview.
Any advice would be great.
Thanks
for the Hololens modify the script in :
$scope.app.go=function() { twx.app.fn.navigate("H&S"); };
and the call
app.go();
I hope to help you
Giuseppe
Hi,
Thanks for the quick reply but unfortunately that hasn't resolved the issue.
I did try making a new experience to see if it was something else in the script causing the fault but that made no difference...
Any other ideas?
I tried the same and it worked, changed the view ...... on double tap event.
I had a project where I had some difficulties to call it. In this case I managed to get it working using some delay with asynchronous function call. So I used some code like this:
//////////////////////////////////////// $scope.app.doorInstructions = function(){ console.warn("called door Instruction"); $timeout( function() { //start timeout $scope.$applyAsync( // start applyAsync function() { //start the intented steps
//-toggel the button back and go to view $scope.view.wdg['toggleButton-2']['pressed']=false; $scope.app.fn.navigate('Instructions'); } //finish def ); //finish applayAsync } , 1000); //finish timeout function // };
/////////////////////////////////////////
May be , this could be helpful also in your case.
An other point is the name ... should it contain &... no idea if this also contribute to the issue...