-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add share module, add header toolbar
- Loading branch information
1 parent
3ea3e3f
commit 0314346
Showing
14 changed files
with
145 additions
and
20 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
children: [] | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class AppRoutingModule { } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
<md-toolbar color="primary" class="toolbar"> | ||
<span>Angular NGrx Material Starter</span> | ||
<span class="spacer"></span> | ||
<button md-button>About</button> | ||
<button md-button>Features</button> | ||
<button md-button>Examples</button> | ||
<button md-icon-button [mdMenuTriggerFor]="toolbarMenu"> | ||
<md-icon>more_vert</md-icon> | ||
</button> | ||
<md-menu #toolbarMenu="mdMenu"> | ||
<button md-menu-item> | ||
<md-icon>person</md-icon> | ||
<span>Manage account</span> | ||
</button> | ||
<button md-menu-item> | ||
<md-icon>settings</md-icon> | ||
<span>Settings</span> | ||
</button> | ||
<button md-menu-item> | ||
<md-icon>power_settings_new</md-icon> | ||
<span>Logout</span> | ||
</button> | ||
</md-menu> | ||
</md-toolbar> | ||
<h1> | ||
{{title}} | ||
|
||
<button md-raised-button>Raised button</button> | ||
</h1> | ||
<router-outlet></router-outlet> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
|
||
.toolbar{ | ||
|
||
button { | ||
margin: 0 10px 0 0; | ||
} | ||
|
||
.spacer { | ||
flex: 1 1 auto; | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
selector: 'anms-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'] | ||
}) | ||
export class AppComponent { | ||
title = 'app works!'; | ||
title = 'anms works!'; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule | ||
], | ||
declarations: [] | ||
}) | ||
export class CoreModule { } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { | ||
MdButtonModule, | ||
MdToolbarModule, | ||
MdMenuModule, | ||
MdIconModule | ||
} from '@angular/material'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
FormsModule, | ||
|
||
MdButtonModule, | ||
MdToolbarModule, | ||
MdMenuModule, | ||
MdIconModule | ||
], | ||
declarations: [], | ||
exports: [ | ||
CommonModule, | ||
FormsModule, | ||
|
||
MdButtonModule, | ||
MdMenuModule, | ||
MdToolbarModule, | ||
MdIconModule | ||
] | ||
}) | ||
export class SharedModule { } |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,26 @@ | ||
/* You can add global styles to this file, and also import other style files */ | ||
@import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; | ||
@import 'reset.scss'; | ||
|
||
@import '~@angular/material/theming'; | ||
// Plus imports for other components in your app. | ||
|
||
// Include the common styles for Angular Material. We include this here so that you only | ||
// have to load a single css file for Angular Material in your app. | ||
// Be sure that you only ever include this mixin once! | ||
@include mat-core(); | ||
|
||
// Define the palettes for your theme using the Material Design palettes available in palette.scss | ||
// (imported above). For each palette, you can optionally specify a default, lighter, and darker | ||
// hue. | ||
$anms-primary: mat-palette($mat-amber); | ||
$anms-accent: mat-palette($mat-pink, A200, A100, A400); | ||
|
||
// The warn palette is optional (defaults to red). | ||
$anms-warn: mat-palette($mat-red); | ||
|
||
// Create the theme object (a Sass map containing all of the palettes). | ||
$anms-theme: mat-light-theme($anms-primary, $anms-accent, $anms-warn); | ||
|
||
// Include theme styles for core and each component used in your app. | ||
// Alternatively, you can import and @include the theme mixins for each component | ||
// that you are using. | ||
@include angular-material-theme($anms-theme); |
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
0314346
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tom, Can you please help me understand how you set up the mappings for the label branding? like how you map 'project-prefix.title.long' to the particular property defined in the en,json files under /i18n folder. Thanks
0314346
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keymanjacob am not sure I understand the question? Also based on the question location ?
0314346
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomastrajan Sorry about the confusion. My question was that in en.json file (angular-ngrx-material-starter/projects/angular-ngrx-material-starter/src/assets/i18n/en.json) we can find properties like "anms.title.long": "Angular NgRx Material Starter". And they are used pretty much everywhere in html and ts files. I want to understand what was done to be able to map them so that we can use these props directly.
0314346
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keymanjacob the project uses ngx-translate to transform keys into real translations based on selected language, hope that helps!