Skip to main content
1-Visitor
November 5, 2019
Solved

Error while debugging Vuforia Studio Project with Javascript

  • November 5, 2019
  • 2 replies
  • 5586 views

Good morning,

while I was trying to debug and run my Vuforia Studio Projekct with Javascript, this error popped up (see studio_error). Also the console from Google Chrome showed me this (see Error_console).

 

I was trying to read from an inputfield and paste it to the console. Actual I want to read from an .txt File, but in this step, I just want to have the output in the output text field.

This is my Javascript:

$scope.einlesen = function(){
var inText = $scope.app.view['Startseite'].wdg['textInput-1'].text; //Text aus dem Inputtext holen und in die Variable inText speichern

console.log("Eingelesener Text: ", inText);
};

 

I call the function when clicking on a button.

Furthermore: Is there no documentation for $scope, $element, $attrs, $injector, $sce, $timeout, $http, $ionicPopup, and $ionicPopover, how to use them, or a general documentation for Javascript with Vuforia Studio, because using "normal" Javascript result every time in a crash, so I have to end the process and restart Vuforia Studio.

 

Thank you for your help.

 

PS: Any clue how I can learn the programming languange? 

 

Best answer by ytella

Hi @Rapha97 ,

I have updated the code as shown below and was able to see the text input displayed on the console:

 

$scope.einlesen = function(){
var inText = $scope.view.wdg['textInput-1'].text; //Text aus dem Inputtext holen und in die Variable inText speichern

console.log("Eingelesener Text: ", inText);
};

 

Please review the below community post for some angularJS documentation:

 

https://community.ptc.com/t5/Vuforia-Studio/What-kind-of-framework-does-Vuforia-Studio-use-Angular/m-p/622985

2 replies

Rapha971-VisitorAuthor
1-Visitor
November 5, 2019

Here the error from chrome

ytella17-PeridotAnswer
17-Peridot
November 6, 2019

Hi @Rapha97 ,

I have updated the code as shown below and was able to see the text input displayed on the console:

 

$scope.einlesen = function(){
var inText = $scope.view.wdg['textInput-1'].text; //Text aus dem Inputtext holen und in die Variable inText speichern

console.log("Eingelesener Text: ", inText);
};

 

Please review the below community post for some angularJS documentation:

 

https://community.ptc.com/t5/Vuforia-Studio/What-kind-of-framework-does-Vuforia-Studio-use-Angular/m-p/622985

Rapha971-VisitorAuthor
1-Visitor
November 7, 2019

Thank you for your answer.

Unfortunately this was the wrong code. That code worked fine.

 

I was trying to read from a .txt File with a "normal" Javascipt, wich I found here (https://stackoverflow.com/questions/14446447/how-to-read-a-local-text-filehttps://social.msdn.microsoft.com/Forums/en-US/64ea2d16-7594-400b-8b25-8b3b9a078eab/read-external-text-file-with-javascript?forum=sidebargadfetdevelopment). After replacing "file" with the var filePath = "file:///..." and deleating 

rawFile.send(null);

 I get the warnin (see attachement). WithrawFile.send(null); I get the errors (see attachement).

Rapha971-VisitorAuthor
1-Visitor
November 7, 2019

Thank you for the fast respond.

Yes that helps a lot.

Is there a way to read files without uploading them? 😄