import { Component, OnInit } from
'@angular/core'
;
import { KeyValue } from
'@angular/common'
;
import { Pipe, PipeTransform } from
'@angular/core'
;
@Component({
selector:
'app-root'
,
templateUrl:
"./app.component.html"
,
styleUrls: [
'./app.component.css'
]
})
export class AppComponent implements OnInit {
gfg: any =
[
{ key:
"3"
, value:
"1700"
},
{ key:
"4"
, value:
"1900"
},
{ key:
"2"
, value:
"1400"
},
{ key:
"1"
, value:
"1300"
},
{ key:
"7"
, value:
"1200"
},
{ key:
"9"
, value:
"1800"
},
{ key:
"8"
, value:
"2100"
},
{ key:
"5"
, value:
"1100"
}
]
ngOnInit() {
this
.gfg.sort((a: any, b: any) =>
a.value.localeCompare(b.value));
}
}