GithubHelp home page GithubHelp logo

Comments (15)

aitboudad avatar aitboudad commented on April 24, 2024 2

@miton18 try with

export function localDashboardResolvable(trans, dStore) {

from angular.

christopherthielen avatar christopherthielen commented on April 24, 2024 1

AoT compatible in beta.4 release

from angular.

miton18 avatar miton18 commented on April 24, 2024 1

Thx @aitboudad it works...... Why ?

from angular.

christopherthielen avatar christopherthielen commented on April 24, 2024

No, not today. I hope to be AoT ready by 1.0 final.

from angular.

christopherthielen avatar christopherthielen commented on April 24, 2024

From @kolkov on September 23, 2016 6:39

OK, thanks!

from angular.

christopherthielen avatar christopherthielen commented on April 24, 2024

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.

christopherthielen avatar christopherthielen commented on April 24, 2024

From @kolkov on December 12, 2016 2:46

I think beta.4 that will compatible.

from angular.

christopherthielen avatar christopherthielen commented on April 24, 2024

From @aitboudad on December 12, 2016 11:55

see #13

from angular.

miton18 avatar miton18 commented on April 24, 2024

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.

marshall007 avatar marshall007 commented on April 24, 2024

@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.

Andras-Csanyi avatar Andras-Csanyi commented on April 24, 2024

@miton18 Check the sample app here, you can find example how to deal with the error you get.

from angular.

miton18 avatar miton18 commented on April 24, 2024

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.

Andras-Csanyi avatar Andras-Csanyi commented on April 24, 2024

@miton18 Honestly, I don't know. I know very little about AoT stuff. I assume anonymity is not favorable.

from angular.

miton18 avatar miton18 commented on April 24, 2024

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.

aitboudad avatar aitboudad commented on April 24, 2024

lambda can't be statically analyzed, for more details check:

from angular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.