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

angular6-json-schema-form has no exported member 'Framework' #106

Closed
1 of 5 tasks
pouriam opened this issue Apr 4, 2019 · 0 comments
Closed
1 of 5 tasks

angular6-json-schema-form has no exported member 'Framework' #106

pouriam opened this issue Apr 4, 2019 · 0 comments

Comments

@pouriam
Copy link

pouriam commented Apr 4, 2019

  • MaterialDesignFrameworkModule — Material Design
  • Bootstrap3FrameworkModule — Bootstrap 3
  • Bootstrap4FrameworkModule — Bootstrap 4
  • NoFrameworkModule — plain HTML
  • Other (creating custom framework)

I am trying to create a custom framework. As of documentation here I am trying to use second approach which is registering my own framework. So when I create my custom framework and try to register it as follow:
frameworkLibrary.setFramework(MyFramework);

I encounter following compile error:

ERROR in projects/dynamic-form/src/lib/dynamic-form/dynamic-form.component.ts(35,40): error TS2345: Argument of type 'typeof MyFramework' is not assignable to parameter of type 'string | Framework'.
  Property 'framework' is missing in type 'typeof MyFramework' but required in type 'Framework'.
projects/dynamic-form/src/lib/frameworks/my-framework/my.framework.d.ts(1,10): error TS2724: Module '"/dev/dynamic-form/node_modules/angular6-json-schema-form/angular6-json-schema-form"' has no exported member 'Framework'. Did you mean 'NoFramework'?

This is how my custom framework class looks like:

import { Framework } from 'angular6-json-schema-form';
import { MyFrameworkComponent } from './my-framework.component';


export declare class MyFramework extends Framework {
    name: string;
    framework: typeof MyFrameworkComponent;
    stylesheets: string[];
    scripts: string[];
}

Even If I remove the extends Framework so the MyFramework class will look like:

import { MyFrameworkComponent } from './my-framework.component';

export declare class MyFramework {
    name: string;
    framework: typeof MyFrameworkComponent;
    stylesheets: string[];
    scripts: string[];
}

I get following compile error message:

ERROR in projects/dynamic-form/src/lib/dynamic-form/dynamic-form.component.ts(35,40): error TS2345: Argument of type 'typeof MyFramework' is not assignable to parameter of type 'string | Framework'.
  Property 'framework' is missing in type 'typeof MyFramework' but required in type 'Framework'.

First I need to make sure that what I am doing to create a custom framework is the proper way to do so and if the answer is yes, any idea how to solve this issue?

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