Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Problem with visible property


Problem with visible property

Hi everyone, 

in my project I put 4 buttons that I want to hide at the start of experience. 

So, once set up the 2 D canvas, I print all the widget property in console with: console.log($; and all is working fine. 


To achieve my porpouse I wrote this function: 


$scope.initializeExperience = function() {
  $['reset']['visible']= false;   
  $['rewind']['visible'] = false;
  $['play']['visible'] = false;
  $['replay']['visible']= false;




but, in the google chrome console appears: 


TypeError: Cannot set property 'visible' of undefined
    at b.$scope.initializeExperience (VM10710 app.js:229)
    at VM10710 app.js:235
    at Object.<anonymous> (VM10710 app.js:240)
    at Object.invoke (VM13 ionic.bundle.min.js:75)
    at S.instance (VM13 ionic.bundle.min.js:122)
    at n (VM13 ionic.bundle.min.js:98)
    at g (VM13 ionic.bundle.min.js:92)
    at VM13 ionic.bundle.min.js:91
    at Object.x.appendViewElement (VM13 ionic.bundle.min.js:471)
    at Object.render (VM13 ionic.bundle.min.js:470)


Any idea?


Hi @leonardosella ,

I think the problem is caused that the widget is not initialized yet when you call the code.

Simple call the code inside one of the events  $ionic.afterEnter or modelLoad:



$scope.$on('$ionicView.afterEnter', function()  {


further examples:

rootScope.$on('modelLoaded', function() { 
// or jquery
angular.element(document).ready(function () {$scope.inializeExperience();});