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

Formio Service Extensibility - Bug fix #59

Closed
anupriya7295 opened this issue Feb 28, 2017 · 1 comment
Closed

Formio Service Extensibility - Bug fix #59

anupriya7295 opened this issue Feb 28, 2017 · 1 comment

Comments

@anupriya7295
Copy link

Hi Travis,
Thank you for the quick response regarding issue #57.

As per your instructions I extended core FormioService class in my own Service class and passed that service variable to <formio> directive but code flow gets stuck in FormioComponent ngOnInit().

This is because when compiler sees <formio> directive it automatically invokes Formio.Component core class after which ngOnInit() function gets executed where there are 2 conditions:

  1. this.form

  2. this.src && !this.service
    After this flow is terminated as there is no condition for both src and service.

    I have raised pull request solving this issue Bugfix/FormioComponent #58 where I have extended formio service in following way
    ## HTML
    <formio src="test.json" service="ExtFormioService"></formio>
    ## component

export class AppComponent {
    @Input() src: string;
    @Input() service: ExtFormioService;   //Extended formioservice class 
    constructor() {
      this.src = 'test.json';
      this.service = new ExtFormioService(this.src);
    }
}

## Extended Service

export class ExtFormioService extends FormioService {
constructor(public src: string) {
super(src);
return this;
} 
}

Consider merging the pull request with your formio master. Please let me know your comments.

@travist
Copy link
Member

travist commented Mar 6, 2017

This is now resolved with beta.1 release!

@travist travist closed this as completed Mar 6, 2017
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