Comments (5)
You encountered this issue because the Typescript compiler couldn't find the expected constructor overload. You can examine available constructors by going to the DataSource declaration. You can find it by calling the Go To Definition
command (usually, it is bound to the F12
key) or by opening the node_modules/devextreme/data/data_source.d.ts
file.
In your case, the basic DataSource initialization code may look as follows:
new DataSource({
load: (loadOptions) => {
return new Promise((r) => r([1,2,3]));
},
byKey: (key) => {
return new Promise((r)=>r(1));
}
})
from devextreme-angular.
Problem is that the real code already does return a promise, and works as expected in 21.2.3. Ill take another look though..
from devextreme-angular.
@slubowsky Could you provide a sample app or an actual code snippet from your application? It will help us investigate the problem.
from devextreme-angular.
@alexserov Maybe something like this? compiles in 21.2.3 - but not 21.2.4
this.dataSource = new DataSource({
load: _loadOptions => {
return lastValueFrom(this.httpClient.post('https://somewhere', {}))
.then((result: any) => {
return {
data: result
};
}).catch(e => {
console.error(e);
});
}
});
from devextreme-angular.
@alexserov looks like removing the catch solves the problem...
from devextreme-angular.
Related Issues (20)
- Angular 11 'CommonJS or AMD Dependencies' warning on devextreme-angular v20.2.4 HOT 2
- TypeError: window.getComputedStyle is not a function HOT 1
- devextreme-angular 21.1.3: dxDataGridColumn deprecated HOT 3
- You are running production build of Inferno in development mode. Use dev:module entry point. HOT 1
- Angular Gantt Chart: Browser hangs if drawing gantt chart with dependencies HOT 1
- ChangeDetection.OnPush for DevExtreme Angular components HOT 1
- Angular 13 with devextreme 21.2.3: TypeError: (0 , _core_renderer__WEBPACK_IMPORTED_MODULE_0__.default)(...)[component] is not a function
- Angular 13: Migrate library to Ivy HOT 4
- Validate file size in the dx-file-uploader. HOT 1
- How to implement a custom page size selector for angular?
- dxo-toolbar not found error & custom toolbar not begin displayed HOT 1
- Angular Observable compatibility
- Angular 13 : Issue with button inside a Textbox
- Dependency Dashboard
- DataGrid RowFilter OData Lookup Bug
- Reporting a vulnerability
- Error when using with Angular 16.0.0 HOT 10
- Angular DxDataGrid: Prevent clearing mouse selection on row expansion
- DevExtreme don't works with Angular 16 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devextreme-angular.