Cannot import WidgetLibraryService
See original GitHub issueVersion: v0.4.0-alpha.7
import { WidgetLibraryService } from 'angular2-json-schema-form';
The error message is has no exported member 'WidgetLibraryService'.
If I use…
import { WidgetLibraryService } from 'angular2-json-schema-form/src/widget-library/widget-library.service';
It can build success, but will get the same error if I use WidgetLibraryService in constructor
constructor(private widgetLibrary: WidgetLibraryService) {}
My project is create by ng create
with angular-cli 1.1.0
{
"name": "angular4",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.1.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/language-service": "^4.0.0",
"@types/jasmine": "2.5.45",
"@types/node": "~6.0.60",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^1.2.1",
"protractor": "~5.1.2",
"ts-node": "~3.0.4",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Developers - Cannot import WidgetLibraryService - - Bountysource
The error message is has no exported member 'WidgetLibraryService'. If I use... import { WidgetLibraryService } from 'angular2-json-schema-form/src/widget ...
Read more >angular2-json-schema-form - npm
import { WidgetLibraryService } from 'angular2-json-schema-form'; import ... React, and jQuery (all linked above), I could not find anything similar for ...
Read more >customized widget doesn't return a value to Angular Json ...
I can see the new widget is replaced in the form but when I click the checkbox, no value is sent to the...
Read more >How to Fix : “ImportError: Cannot import name X” in Python
The following are the major reasons for the occurrence of "ImportError: cannot import name": The imported class is in a circular dependency. The...
Read more >Service Portal configuration page widgets
Service Portal uses widgets for configuration. When you configure a page or a widget for a portal in the Service Portal Configuration page,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yovin99 yes i was able to build a whole custom framework with this lib. Unfortunately it did not scale well so I decided to create my own lib.
But here is a short description how you can achieve that:
Create your custom widgets
Add custom widgets to
declarations
andentryComponents
in yourngModule
:Use your widgets in your components
After that you should have the registration almost done. Now you need to create a reference to your custom widgets in your custom component and provide it to
json-schema-form
asinput
, like so:Class
HTML
@Sebastian-Fitzner Thank you. This helped a lot