Posts

Showing posts with the label nativescript

How to use Observable variable in *ngFor

How to use Observable variable in *ngFor I am using rxjs in my nativescript-angular app. In my case, I realize a simple animation by setting StackLayout's top with an observable variable 'myTop$' . Following codes work well, and the "StackLayout" moves as expected : rxjs 'myTop$' "StackLayout" <AbsoluteLayout width="100%" height="100"> <StackLayout [top]="myTop$ | async" height="30" backgroundColor="#faebd7" width="100%" verticalAlignment="center"> <Label [text]="'abc'"></Label> <StackLayout class="hr-light"></StackLayout> </StackLayout> </AbsoluteLayout> public myTop$:Observable<Number> = interval(1000).pipe(map((animationIndex)=>{ return animationIndex%100; // top range 0->100 }),share()); However, when i put these codes in *ngFor for more animations, it see...

Nativescript Geosearch Error

Nativescript Geosearch Error I am building an ios version of my android app that uses algolia I am building the app using the nativescript - angular frameworks I used the plugin ativeScript-Algolia but everytime I search by aroundLatLng I get the error Error : {"status":400,"reason":"Invalid value for "aroundLatLng" parameter, expected float"} here is the relevant code //in the constructor of the component this.client = new Algolia('ddd', 'aaa'); this.index = this.client.initIndex('index'); //inside ngOnInit let latLng:string = parseFloat(this.lat).toFixed(4) + ',' + parseFloat(this.lng).toFixed(4); this.index.search(this.searchTerms , { aroundLatLng : latLng, aroundRadius: this.radius } , (content , err) => { if(err){ console.log("Error : " + JSON.stringify(err)); }else{ console.log("RESULT IS :...