Comments (4)
@lorentzyip Thank you for raising this issue. I managed to reproduce it and yes it's a bug.
The thing is I just migrated the component to use Angular 6 and Angular CLI for building and packaging and it seems that there's an issue with AOT mode because when I run this ng build --prod --aot=false --build-optimizer=false
it works.
I am working on this bug and I will do my best to fix it as soon as possible,
from ngx-avatar.
@HaithemMosbahi Thank you so much. 👏👏👏
from ngx-avatar.
Hi @lorentzyip I just released a new version 3.0.1 that contains a partial fix for the build prod issue.
Importing AvatarModule should work now, please let me now if you still have any issues.
For now the only thing that doesn't work with prod mode is AvatarModule.forRoot(avatarConfig). I'm working on it to make it AOT friendly
from ngx-avatar.
Let me give more information, the XXX module is a lazy-loading module which imports the AvatarModule. Here are the source codes:
app.module.ts
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app-routing.module.ts
const routes: Routes = [
{
path: '',
redirectTo: 'xxx',
pathMatch: 'full'
},
{
path: 'xxx',
loadChildren: './xxx/xxx.module#XxxModule'
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
app.component.html
<h1>Hello World</h1>
<router-outlet></router-outlet>
xxx.module.ts
@NgModule({
imports: [
CommonModule,
AvatarModule,
XxxRoutingModule
],
declarations: [XxxComponent]
})
export class XxxModule { }
xxx-routing.module.ts
const routes: Routes = [
{
path: '',
component: XxxComponent
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class XxxRoutingModule { }
xxx.component.ts inside xxx module
@Component({
selector: 'app-xxx',
templateUrl: './xxx.component.html',
styleUrls: ['./xxx.component.css']
})
export class XxxComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
xxx.component.html
<ngx-avatar value="HW"></ngx-avatar>
from ngx-avatar.
Related Issues (20)
- Allow no name instead of showing the 'N' character HOT 2
- [name] property not showing initials in internet explorer HOT 1
- Error on Angular 10 HOT 1
- Getting cors error on googleId
- Add Hacktoberfest topic HOT 1
- Hacktoberfest 2020 HOT 1
- Support for Angular 10.x HOT 15
- Release with latest Angular support HOT 32
- Disable image src cache
- Update to Angular 12 HOT 27
- avatar is not rendering when Cypress E2E testing
- Getting CORS block trying to access Instagram HOT 1
- Is there a way to get a on load event from image src? HOT 1
- What is the purpose of the placeholder input? HOT 2
- Is there any way for Dynamic font sizing HOT 1
- 403 when fetching avatar from Google (googleusercontent.com)
- Add option to specify default value for Gravatar
- Processing legacy "View Engine" library - Angular 14 copile-time warning for ngx-avatar
- Add support for Angular 16 HOT 1
- Create ngx-avatar-experimental package on NPM HOT 1
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 ngx-avatar.