Comments (15)
@miton18 try with
export function localDashboardResolvable(trans, dStore) {
from angular.
AoT compatible in beta.4 release
from angular.
Thx @aitboudad it works...... Why ?
from angular.
No, not today. I hope to be AoT ready by 1.0 final.
from angular.
From @kolkov on September 23, 2016 6:39
OK, thanks!
from angular.
From @tonimoeckel on December 11, 2016 22:32
Are there any updates on this? The angular-cli version beta.22 forces us to use AOT compatible libs. So this issue is more important for many developers.
from angular.
From @kolkov on December 12, 2016 2:46
I think beta.4 that will compatible.
from angular.
From @aitboudad on December 12, 2016 11:55
see #13
from angular.
I'm on "ui-router-ng2": "^1.0.0-beta.4"
and "@angular/cli": "1.0.0-rc.2",
not working yet
ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a referen
ce to an exported function (position 22:35 in the original .ts file), resolving symbol States in SOMETHING/src/app/router-states.ts, re
solving symbol AppModule in SOMETHING/src/app/app.module.ts, resolving symbol AppModule in SOMETHING/src/app/app.modu
le.ts, resolving symbol AppModule in SOMETHING/src/app/app.module.ts
from angular.
@miton18 it sounds like you're using an anonymous resolve
function in one or more of your states. Try exporting those as named functions and referencing them as such in router-states.ts
.
from angular.
@miton18 Check the sample app here, you can find example how to deal with the error you get.
from angular.
My State :
{
name: 'localDashboard',
url: '/:dashboardName/:dashboardVersion',
component: ViewDashboardComponent,
resolve: [
new Resolvable('dashboard', (trans, dStore) => {
return new Promise((resolve, reject) => {
let p = trans.params();
console.log('Search ', p.dashboardName, p.dashboardVersion);
let d = dStore.search(decodeURIComponent(p.dashboardName), parseInt(p.dashboardVersion, 10));
if (!d) {
reject();
}
resolve(d.content);
});
}, [Transition, LocalDashboardStorageService])
]
}
No anonymous function but an anonymous Resolvable, what's wrong with that ?
from angular.
@miton18 Honestly, I don't know. I know very little about AoT stuff. I assume anonymity is not favorable.
from angular.
I tried with exported resolver functions
export const localDashboardResolvable = (trans, dStore) => {
...
name: 'localDashboard',
url: '/dashboard/local/:dashboardName/:dashboardVersion',
component: ViewDashboardComponent,
resolve: [
{ token: 'dashboard',
deps: [Transition, LocalDashboardStorageService],
resolveFn: localDashboardResolvable
}
]
same error:
ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to
an exported function (position 31:39 in the original .ts file), resolving symbol urlDashboardResolvable in PATH/router-states.
ts, resolving symbol States in PATH/src/app/router-states.ts, resolving symbol AppModule in PATH/src/app/app.mod
ule.ts, resolving symbol AppModule in PATH/src/app/app.module.ts, resolving symbol AppModule in PATH/src/app/app
.module.ts
from angular.
lambda can't be statically analyzed, for more details check:
- https://gist.github.com/chuckjaz/65dcc2fd5f4f5463e492ed0cb93bca60
- https://github.com/rangle/angular-2-aot-sandbox#current-status
from angular.
Related Issues (20)
- Support Angular 11 HOT 1
- Angular 12 HOT 8
- Future of ui-router? HOT 6
- Error: State 'quizzes' is already defined HOT 2
- uiSref doesn't work unless matching "name". Can't use full path/name. HOT 2
- How to lazy load with chunks HOT 11
- Incompatibility with Angular v13 - removal of `NgModuleFactoryLoader` HOT 1
- Angular 13 Support (libs update) and version policy HOT 13
- [Discussion] Monorepo requirements for ui-router packages HOT 11
- Redirects on local anchor reference HOT 2
- onError not redirecting HOT 1
- Angular v14 support HOT 2
- [bug(?)]: future state declaration's data not passed/merged to/with loaded child state HOT 1
- Angular 15 support HOT 5
- MergeInjector breaks normal Angular DI priority HOT 3
- [question] Lazy loaded module empty after creating
- Breaks when building with Angular 16
- Angular 16 support HOT 9
- Angular 17 support HOT 4
- Incorrect Ui Routing on iOS 17 safari private browsing mode.
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 angular.