I'm initializing an object in angular with un-ordered key defined but when I print it on html it automatically changes to alphabetically.
I've tried to resolve using tslint.json
to set some rules like as follows
{
"extends": ["tslint:recommended"],
"rules": {
"object-literal-sort-keys": false
}
}
as well as
"jsRules":{
"object-literal-sort-keys": false,
}
but nothing effect on expected output.
initialize object in App.component.ts
abc: Object = {'State': 'asd', '1': 'roshan', '2': 'ramanuj', 'city': 252};
app.component.html
<div>{{ abc | json }}</div>
I expect the output is {"State": "asd", "1": "roshan", "2": "ramanuj", "city": 252 }
but actual output is { "1": "roshan", "2": "ramanuj", "State": "asd", "city": 252 }