I find a new problem,
I would like to count @NAME
to set array FACET[]
for show @KEY
Myjson
" RESULT":{
"FACET":[
{ "@NAME" : "creator",
"@COUNT" : "20",
"FACET_VALUES":[
{
"@KEY":"Book Company1",
"@VALUE":"13"},
{
"@KEY":"Book Company1?",
"@VALUE":"10"}],
{ "@NAME" : "lang",
"@COUNT" : "70",
"FACET_VALUES":[
{
"@KEY":"tha",
"@VALUE":"33"},
{
"@KEY":"eng",
"@VALUE":"42"}
],
{ "@NAME" : "bnb",
"@COUNT" : "64",
"FACET_VALUES":[
{
.
.
.
]
.
optionsFn(): void {
this.http.get("my_url")
.subscribe(data =>{
this.date=data.json().RESULT.FACET; //get @NAME
},error=>{
err => console.error(err),
() => console.log('getRepos completed')
);
console.log(this.date);
console.log(this.date);
this.goToapply()
}
goToapply(){
this.http.get("my_url")
.subscribe(data =>{
this.foundRepos=data.json().RESULT.FACET[0,1,2,3.4......].FACET_VALUES; ///get @KEY
},error=>{
console.log(error);
} );
}
..
<ion-label>Filterr</ion-label>
<ion-select [(ngModel)]="refine" (ionChange)="optionsFn();">
<ion-option value="..." *ngFor="let item of date">{{item["@NAME"]}},({{item["@COUNT"]}})</ion-option>
</ion-select>
<ion-list>
<ion-item *ngFor="let item of foundRepos" (click)="itemClicked($event,item)">
<h3> {{ item[@KEY"] }}</h3>
</ion-item>
</ion-list>
This value="..."
I want to keep it to string
for to use, but zi have know idea.
example : count
@NAME = 3 (creator,lang,bnb)
,and getvalue="..." = 0,1,2 (0==creator ,1==lang ,2==bnb)
When I selectlang
I get1
, I use this toFACET[1].FACET_VALUES
, So that I get@KEY
Sorry to write wrong. My english isn't very good.
See Question&Answers more detail:os