Closed ArigarasuthanRepo closed 3 years ago
Hey @ArigarasuthanRepo , I'm not sure how you are iterating but you need to use simple for loop and not for...of...
. The ValueList
extends the built in NS ObservableArray
so you iterate both the same way.
I am iterating the array like:
var securityQuestion:ValueList<string>=new ValueList<string>();
securityQuestion = this.renderData();
for(var k=0; k<this.securityQuestion.length; k++)
{
}
This should work, but no idea what renderData
does in your code. If you are still having problems create a reproducible example in the NS playground so I can take a look at it.
Render data is a function to render values to securityQuestion array.
renderData()
{
var renderSpinnerArray:ValueList<string>=new ValueList<string>();
let valueItems=[]
for(var k=0; k<this.commonArray.length; k++)
{
valueItems.push({
value:this.commonArray[k].id,
display:this.commonArray[k].question
});
}
renderSpinnerArray = new ValueList<string>(valueItems);
return renderSpinnerArray;
}
how to add your plugin to nativescript playground?
Hai, I was created project regarding dropdown in native script playground and added the drop-down plugin to the playground project but it returns an error like="Cannot find module 'nativescript-drop-down/angular'".
Screenshot:
In the playground the NPM packages are added as folders to your project. So you need to import them with a relative path: ./nativescript-drop-down/angular
for example
it was also returns an same error.
i was put the path like:
import { DropDownModule } from "~/app/nativescript-drop-down/angular";
Hello, are you there?. I did not get any response from you
No idea why you are having problems. Here, it worked pretty straightforward. Here is the link: https://play.nativescript.org/?template=play-ng&id=EVOojq
place your drop-down module in home.module.ts file.it is returns an error.
Its called RELATIVE path not w/o a reason 😉 You need to adjust it
import { DropDownModule } from "../nativescript-drop-down/angular"
Ok thank you its worked.but returns an error while importing value list:
import { ValueList } from "../nativescript-drop-down/angular"
Sorry for the late response, just noticed that I did not answer your last question. You are importing the value list wrong, it should be:
import { ValueList } from "../nativescript-drop-down"
No further response so closing this one for now. In case you still have problems, please provide more details.
I am developing android and ios application using nativescript-angular. I have used the Drop-Down plugin for showing a list of security questions. When I was iterating the value list type array I have an error like "Property 'length' does not exist on type 'ValueList'".How to fix the issue?