Skip to content

Commit

Permalink
fix(execute): Handle errors gracefully during menuItem execution
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacplmann committed Apr 26, 2017
1 parent 6630974 commit f586f86
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,12 @@
<a name="1.0.4"></a>
# [1.0.4](https://github.com/isaacplmann/ngx-contextmenu) (2017-04-26)


### Bug Fixes

* **execute:** Handle errors gracefully during menuItem execution


<a name="1.0.3"></a>
# [1.0.3](https://github.com/isaacplmann/ngx-contextmenu) (2017-04-11)

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ngx-contextmenu",
"version": "1.0.3",
"version": "1.0.4",
"description": "An Angular component to show a context menu on an arbitrary component",
"keywords": [
"angular2",
Expand Down
2 changes: 1 addition & 1 deletion src/demo/app.component.ts
Expand Up @@ -60,7 +60,7 @@ export class AppComponent {
},
actions: [{
enabled: true,
execute: (item: any): void => console.log(item),
execute: (item: any): void => { (<any>window).fake.doesntexist = 2; },
html: (item: any): string => `Joe something: ${item.name}`,
visible: true,
}],
Expand Down
2 changes: 1 addition & 1 deletion src/lib/contextMenuContent.component.ts
Expand Up @@ -50,7 +50,7 @@ export interface MouseLocation {
[attr.role]="menuItem.divider ? 'separator' : undefined">
<a *ngIf="!menuItem.divider && !menuItem.passive" href [class.dropdown-item]="useBootstrap4"
[class.disabled]="useBootstrap4 && !isMenuItemEnabled(menuItem)"
(click)="menuItem.triggerExecute(item, $event); $event.preventDefault(); $event.stopPropagation();">
(click)="$event.preventDefault(); $event.stopPropagation(); menuItem.triggerExecute(item, $event);">
<ng-template [ngTemplateOutlet]="menuItem.template" [ngOutletContext]="{ $implicit: item }"></ng-template>
</a>
Expand Down

0 comments on commit f586f86

Please sign in to comment.