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

How to use alertify.js with Angular CLI: 1.5.4? #154

Open
ShadowQueen opened this issue Dec 26, 2017 · 0 comments
Open

How to use alertify.js with Angular CLI: 1.5.4? #154

ShadowQueen opened this issue Dec 26, 2017 · 0 comments

Comments

@ShadowQueen
Copy link

ShadowQueen commented Dec 26, 2017

Hello,

I am trying to use alertify.js with Angular CLI: 1.5.4, but no luck.
In the package.json file I have these packages:

"@types/alertify": "^0.3.30",
"alertify.js": "^1.0.12",

Angular CLI: 1.5.4
Node: 8.9.1
OS: win32 x64
Angular: 5.1.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.4
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.4
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.8.1
Also, I have included in angular-cli.json styles and js for alertify.

I have imported alertify.js in the component:

import * as alertify from 'alertify.js';

deletePart(selectedItem: any) {
    alertify.set({ buttonReverse: true });   // alertify is undefined
    alertify.set({ labels: { ok: this.notifications.Ok, cancel: this.notifications.Cancel } });
}

Error message:

TabPositionsComponent.html:74 ERROR TypeError: WEBPACK_IMPORTED_MODULE_7_alertify_js.set is not a function
at TabPositionsComponent.deletePart (tab-positions.component.ts:201)
at Object.eval [as handleEvent] (TabPositionsComponent.html:77)
at handleEvent (core.js:13581)
at callWithDebugContext (core.js:15090)
at Object.debugHandleEvent [as handleEvent] (core.js:14677)
at dispatchEvent (core.js:9990)
at eval (core.js:10611)
at HTMLButtonElement.eval (platform-browser.js:2628)
at ZoneDelegate.invokeTask (zone.js:425)
at Object.onInvokeTask (core.js:4744)

Am I doing something wrong? Any help would be appreciated?

Thank you

@ShadowQueen ShadowQueen changed the title AHow to use alertify.js with Angular CLI: 1.5.4? How to use alertify.js with Angular CLI: 1.5.4? Dec 26, 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

1 participant