I think there is lack of an important event. I want to check something after every page change.
Is there any other way to do this?
I think there is lack of an important event. I want to check something after every page change.
Is there any other way to do this?
hi friends,
I added my switch in html like this:
<ons-switch var=“mySwitch” modifier=“list-item”></ons-switch>
I tried to set switch status from my angular controller but on start it says it is undefined. I think controller works before it install itselfs.
I tried this: $scope.$on(’$viewContentLoaded’) and this: ons.ready() but both of them didn’t help.
Finnaly I created a loop and checked it in every 10 miliseconds then I do my stuff. It worked for me but I think that for sure there is a better solution (with ng-model or etc) but I didn’t find it.
Has anyone idea about this?
My custom loop looks like this:
var waitTillContentLoaded = setInterval(function(){
if(mySwitch){
// update
mySwitch.on('change', function(){
// ...
});
// clear loop
clearInterval(waitTillContentLoaded);
}else{
console.log("nope");
}
}, 10);
By the way, this textarea has to be heigher…
@fran-diox: thanks fran. I though that I can find a attribute for this :) but of course it is enough:
I think I will use that funny one: $(’#scroll’).scrollTop(1000000);