Last active
          February 3, 2025 14:50 
        
      - 
      
- 
        Save mpalourdio/e05b4495de2abeeecfcf92d70e4ef93e to your computer and use it in GitHub Desktop. 
    ng-http-loader - Custom component
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <router-outlet></router-outlet> | |
| <ng-http-loader [entryComponent]="awesomeComponent" ></ng-http-loader> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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 { | |
| } | 
That's just an example. It represents your own spinner component you want to integrate.
"ng: Can't bind to 'entryComponent' since it isn't a known property of 'spinner'"
@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>
thank you, can you made a simple example of AwesomeComponent ?
@DaruoMatrix look at this example
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
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