This file contains 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
1) In 'main-page-module.ts': | |
import { NgModule } from '@angular/core'; | |
import { CommonModule } from '@angular/common'; | |
// Import Bootstrap | |
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; | |
// Import components | |
import { MainPageComponent } from './main-page.component'; | |
import { NavbarComponent } from './components/navbar/navbar.component'; | |
import { FooterComponent } from './components/footer/footer.component'; | |
import { JumbotronComponent } from './components/jumbotron/jumbotron.component'; |
This file contains 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
1) Import the 'AppTranslationService' as a 'provider' in the module, more info on this here: | |
"Declare the service in the providers of a @NgModule which has both SearchComponent and TransferComponent in its declarations. 9 times out of 10 this is the right solution!" | |
https://stackoverflow.com/questions/42567674/share-data-between-components-using-a-service-in-angular2 | |
import { NgModule } from '@angular/core'; | |
import { CommonModule } from '@angular/common'; | |
// Import Bootstrap | |
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; | |
// Import components | |
import { MainPageComponent } from './main-page.component'; |
This file contains 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
Situation: a main-page module with a navbar-component :) | |
1) In 'main-page.module': | |
import { NgModule } from '@angular/core'; | |
import { CommonModule } from '@angular/common'; | |
// Import Bootstrap | |
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; | |
// Import components | |
import { MainPageComponent } from './main-page.component'; | |
import { NavbarComponent } from './components/navbar/navbar.component'; |
This file contains 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
More info on this here: | |
https://github.com/ngx-translate/http-loader | |
https://stackblitz.com/github/ngx-translate/example?file=src%2Fapp%2Fapp.component.ts | |
1) Install through npm: | |
npm install @ngx-translate/core --save | |
npm install @ngx-translate/http-loader --save | |
2) In 'main-page.module': | |
import { NgModule } from '@angular/core'; |
This file contains 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
I'm not sure I understand everything here correctly - but it works :P | |
The order of info flow is as follows: | |
component -> dispatcher -> actions -> reducers - > component | |
1) In 'register-page.module': | |
import { NgModule } from '@angular/core'; | |
import { CommonModule } from '@angular/common'; | |
// Import Bootstrap | |
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; | |
// Import components |
This file contains 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
More information here: | |
https://github.com/ngrx/platform/blob/master/docs/store/selectors.md | |
https://toddmotto.com/ngrx-store-understanding-state-selectors | |
1) In register-page.component.ts: | |
import { Component, OnInit } from '@angular/core'; | |
// Import for reducers to work | |
import { Store } from '@ngrx/store'; | |
import { Observable } from 'rxjs'; | |
// Import State for reducers |
This file contains 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
1) In 'app.module.ts' | |
- import reducers: | |
import { reducers } from './app.reducers'; | |
- make sure your module looks similar: | |
@NgModule({ | |
declarations: [AppComponent], | |
imports: [ | |
BrowserModule, | |
NgbModule.forRoot(), |
This file contains 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
More infor here: https://github.com/ngrx/platform/blob/master/docs/store-devtools/README.md | |
Instructions can be found here: | |
https://github.com/ngrx/platform/blob/master/docs/store-devtools/README.md | |
1) install through npm: | |
npm install @ngrx/store-devtools --save | |
2) Download the Redux Devtools Extension: | |
https://github.com/zalmoxisus/redux-devtools-extension/ |
This file contains 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
Install ngrx-store through npm: npm install @ngrx/store | |
(more info here: https://github.com/ngrx/platform/blob/master/docs/store/README.md) | |
then... | |
1) Add a relular Angular Router - here's a good tutorial: | |
https://angular.io/guide/router | |
- make sure that there is the <base> element to the index.html as the first child in the <head> tag: | |
<base href="/"> |
This file contains 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
Maybe you forgot to import in in your 'module.ts' file? | |
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; | |
@NgModule({ | |
imports: [CommonModule, NgbModule.forRoot()] | |
}) |