kevcjones / ngx-simple-modal

A simple unopinionated framework to implement simple modal based behaviour in angular (v2+) projects.
MIT License
52 stars 27 forks source link

Property 'onKeydownHandler' is private and only accessible within class 'SimpleModalComponent<T, T1>'. #47

Closed freon27 closed 6 years ago

freon27 commented 6 years ago

Hi,

It seems that the handler function is defined as private which means it's not accessible from within the template. This isn't an issue when doing a CLI build but generates an error when trying to use ng-packagr under Angular 6 (worked ok in angular 5).

kevcjones-archived commented 6 years ago

Ah , thanks Im kinda locked down for the moment in 5 land right now. Is this as easy as making it public then?

On Mon, 16 Jul 2018, 09:52 Nick Peters, notifications@github.com wrote:

Hi,

It seems that the handler function is defined as private which means it's not accessible from within the template. This isn't an issue when doing a CLI build but generates an error when trying to use ng-packagr under Angular 6 (worked ok in angular 5).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/KevCJones/ngx-simple-modal/issues/47, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqe8BeDQPBjHT9-0K__gX7GXsmAYlsZks5uHFQ0gaJpZM4VQxA9 .

freon27 commented 6 years ago

Yep, it appears so....

We manually hacked the definitions file to remove the private modifier and that was enough to make it work. It makes sense that it needs to be public anyway since it's called from outside the class. On Mon 16. Jul 2018 at 17:34, Kevin C Jones notifications@github.com wrote:

Ah , thanks Im kinda locked down for the moment in 5 land right now. Is this as easy as making it public then?

On Mon, 16 Jul 2018, 09:52 Nick Peters, notifications@github.com wrote:

Hi,

It seems that the handler function is defined as private which means it's not accessible from within the template. This isn't an issue when doing a CLI build but generates an error when trying to use ng-packagr under Angular 6 (worked ok in angular 5).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/KevCJones/ngx-simple-modal/issues/47, or mute the thread < https://github.com/notifications/unsubscribe-auth/AAqe8BeDQPBjHT9-0K__gX7GXsmAYlsZks5uHFQ0gaJpZM4VQxA9

.

— You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub https://github.com/KevCJones/ngx-simple-modal/issues/47#issuecomment-405288511, or mute the thread https://github.com/notifications/unsubscribe-auth/AAW7jp3c5JQoqjkP9cYlbwA1yB1cG1AOks5uHLKQgaJpZM4VQxA9 .

kevcjones-archived commented 6 years ago

i'm willing to make this public its not a big thing but its not something intended to be called from outside originally. The @HostListener decorator was more about automatically handling based on the config you set.

  @HostListener('document:keydown.escape', ['$event'])
  onKeydownHandler(evt: KeyboardEvent) {
    if (this.options && this.options.closeOnEscape) {
      this.close();
    }
  }

I don't suppose you'd be happy to share your ng-packagr so i could try and replicate here? Not used it before it would be helped me along too.

K

freon27 commented 6 years ago

This is all that's in the ng-packagr.json:

{ "$schema": "./node_modules/ng-packagr/ng-package.schema.json", "lib": { "entryFile": "public_api.ts", "styleIncludePaths": ["src/styles.scss"] }, "whitelistedNonPeerDependencies": ["."] }

kevcjones-archived commented 6 years ago

Thanks, if you hadn't noticed I released a new version which means you can remove your patched copy

On Mon, 23 Jul 2018, 08:43 Nick Peters, notifications@github.com wrote:

This is all that's in the ng-packagr.json:

{ "$schema": "./node_modules/ng-packagr/ng-package.schema.json", "lib": { "entryFile": "public_api.ts", "styleIncludePaths": ["src/styles.scss"] }, "whitelistedNonPeerDependencies": ["."] }

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/KevCJones/ngx-simple-modal/issues/47#issuecomment-406969069, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqe8C06hcmzT-mbTqK48wvy9_ItOdKWks5uJX6NgaJpZM4VQxA9 .

freon27 commented 6 years ago

Cool, thanks!