@@ -3,9 +3,10 @@ import { BrowserModule } from '@angular/platform-browser';
33import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' ;
44import { HttpClient , HttpClientModule , HttpParams } from '@angular/common/http' ;
55import { lastValueFrom } from 'rxjs' ;
6- import { DxAutocompleteModule , DxTemplateModule } from 'devextreme-angular' ;
7- import { CustomStore , ODataStore } from 'devextreme-angular/common/data' ;
6+ import { DxAutocompleteModule } from 'devextreme-angular' ;
7+ import { CustomStore } from 'devextreme-angular/common/data' ;
88import { Service } from './app.service' ;
9+ import * as AspNetData from 'devextreme-aspnet-data-nojquery' ;
910
1011if ( ! / l o c a l h o s t / . test ( document . location . host ) ) {
1112 enableProdMode ( ) ;
@@ -35,7 +36,7 @@ export class AppComponent {
3536
3637 positions : string [ ] ;
3738
38- states : ODataStore ;
39+ states : CustomStore ;
3940
4041 clientsStore : CustomStore ;
4142
@@ -70,14 +71,12 @@ export class AppComponent {
7071 . then ( ( { data } : { data : Record < string , unknown > [ ] } ) => ( {
7172 data,
7273 } ) )
73- . catch ( ( error ) => { throw 'Data Loading Error' ; } ) ;
74+ . catch ( ( ) => { throw 'Data Loading Error' ; } ) ;
7475 } ,
7576 } ) ;
76- this . states = new ODataStore ( {
77- version : 2 ,
78- url : 'https://js.devexpress.com/Demos/DevAV/odata/States?$select=Sate_ID,State_Long,State_Short' ,
79- key : 'Sate_ID' ,
80- keyType : 'Int32' ,
77+ this . states = AspNetData . createStore ( {
78+ loadUrl : 'https://js.devexpress.com/Demos/NetCore/api/DataGridStatesLookup' ,
79+ key : 'ID' ,
8180 } ) ;
8281 this . names = service . getNames ( ) ;
8382 this . surnames = service . getSurnames ( ) ;
@@ -99,7 +98,6 @@ export class AppComponent {
9998 imports : [
10099 BrowserModule ,
101100 DxAutocompleteModule ,
102- DxTemplateModule ,
103101 HttpClientModule ,
104102 ] ,
105103 declarations : [ AppComponent ] ,
0 commit comments