Skip to content

Instantly share code, notes, and snippets.

@mpalourdio
Last active May 2, 2022
Embed
What would you like to do?
Custom component
<router-outlet></router-outlet>
<ng-http-loader [entryComponent]="awesomeComponent" ></ng-http-loader>
import { Component } from '@angular/core';
import { AwesomeComponent } from 'my.awesome.component';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
public awesomeComponent = AwesomeComponent;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { SecondComponent } from './second/second.component';
import { FirstComponent } from './first/first.component';
import { AppRoutingModule } from './app.routing.module';
import { NgHttpLoaderModule } from 'ng-http-loader';
import { UploadComponent } from './upload/upload.component';
import { HttpService } from './http.service';
import { UploadService } from './upload/upload.service';
import { HttpClientModule, HttpClientXsrfModule } from '@angular/common/http';
import { AwesomeComponent } from 'my.awesome.component';
@NgModule({
declarations: [
AppComponent,
FirstComponent,
SecondComponent,
UploadComponent,
],
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
HttpClientXsrfModule,
AppRoutingModule,
NgHttpLoaderModule.forRoot(),
],
providers: [
HttpService,
UploadService,
],
bootstrap: [AppComponent]
})
export class AppModule {
}
@xts-velkumars
Copy link

xts-velkumars commented Mar 9, 2018

Good day,
I'm trying to implement my own custom spinner.
Could you please share me 'my.awesome.component' file. it would be real appreciated

@mpalourdio
Copy link
Author

mpalourdio commented Mar 9, 2018

That's just an example. It represents your own spinner component you want to integrate.

@claudioontheweb
Copy link

claudioontheweb commented Jul 24, 2018

"ng: Can't bind to 'entryComponent' since it isn't a known property of 'spinner'"

@mpalourdio
Copy link
Author

mpalourdio commented Aug 6, 2018

@hackherlin I have update the gists, if your are using ng-http-loader v3, the <spinner> component selector has been replaced by <ng-http-loader>

@DaruoMatrix
Copy link

DaruoMatrix commented Dec 13, 2018

thank you, can you made a simple example of AwesomeComponent ?

@mpalourdio
Copy link
Author

mpalourdio commented Jan 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment