Comments (5)
according to jvandemo/generator-angular2-library#116 (thx @maychan111)
Next update, it should work with AOT compilation
from ng-snotify.
Thanks for your temporary solution, it's work very well.
from ng-snotify.
Thank you for reporting! I really appreciate it.
Currently I'm researching this issue.
This happens because of aot compilation.
Temporarily solution is ng build --aot=false --prod
from ng-snotify.
I'm getting this today, why is that?
Date: 2018-06-22T10:04:13.172Z - Hash: 8dfa24488b39ef243e34 - Time: 10375ms
5 unchanged chunks
chunk {main} main.js, main.js.map (main) 16.2 MB [initial] [rendered]
WARNING in ./src/app/app.component.ngfactory.js
7:0-88 "export 'ɵb' (reexported as 'ɵb_5') was not found in 'ng-snotify'
WARNING in ./src/app/app.component.ngfactory.js
7:0-88 "export 'ɵc' (reexported as 'ɵc_6') was not found in 'ng-snotify'
i 「wdm」: Compiled with warnings.
I'll spare you my whole modules files but i made sure to have the entries in every section here :
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import {SnotifyModule, SnotifyService, ToastDefaults} from 'ng-snotify';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
SnotifyModule
],
providers: [
{ provide: 'SnotifyToastConfig', useValue: ToastDefaults},
SnotifyService
],
bootstrap: [AppComponent]
})
export class AppModule { }
as for my app.component.ts
:
import { Component } from '@angular/core';
import {Observable} from 'rxjs';
import {SnotifyService, SnotifyPosition, SnotifyToastConfig} from 'ng-snotify';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
constructor(private snotifyService: SnotifyService) {
setTimeout(() => {
this.onAsyncLoading();
}, 2000);
}
getConfig(): SnotifyToastConfig {
this.snotifyService.setDefaults({
global: {
newOnTop: true,
maxAtPosition: 6,
maxOnScreen: 8,
}
});
return {
bodyMaxLength: 80,
titleMaxLength: 15,
backdrop: -1,
position: SnotifyPosition.rightTop,
timeout: 3000,
showProgressBar: false,
closeOnClick: true,
pauseOnHover: true
};
}
onSuccess() {
this.snotifyService.success('Réussite', 'Réussite', this.getConfig());
}
onInfo() {
this.snotifyService.info('Information', 'Information', this.getConfig());
}
onError() {
this.snotifyService.error('Erreur', 'Erreur', this.getConfig());
}
onWarning() {
this.snotifyService.warning('Warning', 'Warning', this.getConfig());
}
onAsyncLoading() {
const errorAction = Observable.create(observer => {
setTimeout(() => {
observer.error({
title: 'Error',
body: 'Example. Error 404. Service not found',
});
}, 2000);
});
const successAction = Observable.create(observer => {
setTimeout(() => {
observer.next({
body: 'Still loading.....',
});
}, 2000);
setTimeout(() => {
observer.next({
title: 'Success',
body: 'Example. Data loaded!',
config: {
closeOnClick: true,
timeout: 5000,
showProgressBar: true
}
});
observer.complete();
}, 5000);
});
const {timeout, ...config} = this.getConfig(); // Omit timeout
this.snotifyService.async('This will resolve with error', 'Async', errorAction, config);
this.snotifyService.async('This will resolve with success', successAction, config);
this.snotifyService.async('Called with promise', 'Error async',
new Promise((resolve, reject) => {
setTimeout(() => reject({
title: 'Error!!!',
body: 'We got an example error!',
config: {
closeOnClick: true
}
}), 1000);
setTimeout(() => resolve(), 1500);
}), config);
}
}
and my html :
<div class="main">
<app-logged-in class="logged-in"></app-logged-in>
</div>
<ng-snotify class="material"></ng-snotify>
I am compiling in aot.
EDIT :
but if I add the --aot=false flag I don't get this error.
here's my package.json :
{
"name": "web.ui",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --aot --proxy-config proxy.json",
"build": "ng b --prod",
"test": "ng test",
"lint": "ng lint"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.0.4",
"@angular/cdk": "^6.2.1",
"@angular/common": "^6.0.4",
"@angular/compiler": "^6.0.4",
"@angular/core": "^6.0.4",
"@angular/forms": "^6.0.4",
"@angular/http": "^6.0.4",
"@angular/material": "^6.2.1",
"@angular/platform-browser": "^6.0.4",
"@angular/platform-browser-dynamic": "^6.0.4",
"@angular/router": "^6.0.4",
"@ncstate/sat-popover": "^2.1.1",
"@ngx-translate/i18n-polyfill": "^1.0.0",
"@types/underscore": "^1.8.7",
"angular-font-awesome": "^3.1.2",
"bootstrap": "^4.1.1",
"classlist.js": "^1.1.20150312",
"core-js": "^2.5.3",
"file-saver": "^1.3.8",
"font-awesome": "^4.7.0",
"iconv-lite": "^0.4.23",
"jquery": "^3.3.1",
"lodash": "^4.17.5",
"ng-snotify": "^4.3.1",
"ng2-ion-range-slider": "^2.0.0",
"ngx-bootstrap": "^3.0.0",
"ngx-dropzone-wrapper": "^6.1.0",
"popper.js": "^1.14.3",
"rxjs": "^6.2.0",
"typescript": "2.7.2",
"underscore": "^1.9.1",
"web-animations-js": "^2.3.1",
"zone.js": "^0.8.20"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.6.8",
"@angular/cli": "^6.0.8",
"@angular/compiler-cli": "^6.0.4",
"@angular/language-service": "^6.0.4",
"@types/jasmine": "^2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~10.3.2",
"codelyzer": "^4.2.1",
"postcss-modules": "^1.1.0",
"protractor": "~5.3.0",
"ts-node": "~6.1.0",
"tslint": "~5.10.0"
}
}
from ng-snotify.
the --aot
was causing it. I remember i had to use it in angular 5 to be in AOT mode on ng serve not sure if that's still the case in angular 6.
from ng-snotify.
Related Issues (20)
- Support for Angular 11
- Support for Angular 11
- Upgrade to support angular v10+ HOT 1
- Any chance to update for Angular 12+ please?
- Get confirm/ prompt data through variable ?
- Dynamic title/body ?
- How to delete a record on confirm box "yes"
- cannot install: latest angular
- Moved to ngx-snotifire HOT 1
- How to remove SnotifyToast by button/icon in html template
- Can someone take over maintaining this package please?
- Remove SnotifyToast when clicking outside or pressing escape
- After Updating Ng Snootify in Angular 9 Bugs HOT 21
- Issue with Angular 9 Ivy after upgrading to ng-snotify 9.0.0 HOT 2
- Cannot Import Css in Stackblitz in Angular 9 HOT 2
- Cannot read property "toast" of undefined HOT 2
- I use styles.less, cannot use *.scss [ver 9.0.1]
- confirm backdrop is hidden when another notification is closed.
- Can I hide the toaster when rout change? HOT 1
- Undefined config HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-snotify.