Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module Error on QuickStart #34

Closed
rightisleft opened this issue Feb 28, 2017 · 3 comments
Closed

Module Error on QuickStart #34

rightisleft opened this issue Feb 28, 2017 · 3 comments

Comments

@rightisleft
Copy link

rightisleft commented Feb 28, 2017

Im using Angular-cli's implemantion of webpack:

➜  web git:(master) ✗ ng -v

                             _                           _  _
  __ _  _ __    __ _  _   _ | |  __ _  _ __         ___ | |(_)
 / _` || '_ \  / _` || | | || | / _` || '__|_____  / __|| || |
| (_| || | | || (_| || |_| || || (_| || |  |_____|| (__ | || |
 \__,_||_| |_| \__, | \__,_||_| \__,_||_|          \___||_||_|
               |___/
angular-cli: 1.0.0-beta.26
node: 6.9.1
os: darwin x64
@angular/common: 2.3.1
@angular/compiler: 2.3.1
@angular/core: 2.3.1
@angular/forms: 2.3.1
@angular/http: 2.3.1
@angular/platform-browser: 2.3.1
@angular/platform-browser-dynamic: 2.3.1
@angular/router: 3.3.1
@angular/compiler-cli: 2.3.1

Im trying to follow your quickstart guide and get the following:

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, resolving symbol CONFIG_OBJ in /Users/jmurphy/projects/business/web/node_modules/ng2-restangular/dist/esm/src/ng2-restangular.module.d.ts, resolving symbol RestangularModule in /Users/jmurphy/projects/business/web/node_modules/ng2-restangular/dist/esm/src/ng2-restangular.module.d.ts, resolving symbol AppModule in /Users/jmurphy/projects/business/web/src/app/app.module.ts, resolving symbol AppModule in /Users/jmurphy/projects/business/web/src/app/app.module.ts

export function httpConfigurator(restangular: Restangular) {
  return restangular.withConfig((RestangularConfigurer) => {
    RestangularConfigurer.setBaseUrl('https://randomuser.me/api/');
  });
}

...
RestangularModule.forRoot(httpConfigurator),

@rightisleft
Copy link
Author

I've tried a few permutations of this. The demo also shows calling forRoot with an inline function. That results on the same error.

Is this actually an issue with ConfigObject?

CONFIG_OBJ in /Users/jmurphy/projects/business/web/node_modules/ng2-restangular/dist/esm/src/ng2-restangular.module.d.ts?

@rightisleft
Copy link
Author

Any update on this?

@logvinoleg89
Copy link
Collaborator

Hi @rightisleft. Please submit this part

export function httpConfigurator(restangular: Restangular) {
  return restangular.withConfig((RestangularConfigurer) => {
    RestangularConfigurer.setBaseUrl('https://randomuser.me/api/');
  });
}

to

export function RestangularConfigFactory (RestangularProvider) {
  RestangularProvider.setBaseUrl('https://randomuser.me/api/');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants