├── .editorconfig ├── .gitignore ├── README.md ├── angular-cli.json ├── e2e ├── app.e2e-spec.ts ├── app.po.ts └── tsconfig.json ├── karma.conf.js ├── package.json ├── protractor.conf.js ├── src ├── app │ ├── app.component.ts │ ├── app.module.ts │ ├── app.routing.ts │ ├── pages │ │ ├── dashboard │ │ │ └── dashboard.component.ts │ │ ├── data.service.ts │ │ ├── pages.module.ts │ │ ├── posts │ │ │ └── posts.component.ts │ │ ├── settings │ │ │ └── settings.component.ts │ │ ├── todos │ │ │ └── todos.component.ts │ │ └── users │ │ │ └── users.component.ts │ └── ui │ │ ├── layout │ │ ├── header │ │ │ └── header.component.ts │ │ ├── layout.component.ts │ │ ├── main │ │ │ └── main.component.ts │ │ └── sidebar │ │ │ └── sidebar.component.ts │ │ └── ui.module.ts ├── assets │ └── .gitkeep ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.css ├── test.ts └── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | 10 | # IDEs and editors 11 | /.idea 12 | .project 13 | .classpath 14 | .c9/ 15 | *.launch 16 | .settings/ 17 | 18 | # IDE - VSCode 19 | .vscode/* 20 | !.vscode/settings.json 21 | !.vscode/tasks.json 22 | !.vscode/launch.json 23 | !.vscode/extensions.json 24 | 25 | # misc 26 | /.sass-cache 27 | /connect.lock 28 | /coverage/* 29 | /libpeerconnection.log 30 | npm-debug.log 31 | testem.log 32 | /typings 33 | 34 | # e2e 35 | /e2e/*.js 36 | /e2e/*.map 37 | 38 | #System Files 39 | .DS_Store 40 | Thumbs.db 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TutorialAngularStylingClarity 2 | 3 | This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.30. 4 | 5 | ## Development server 6 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 7 | 8 | ## Code scaffolding 9 | 10 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`. 11 | 12 | ## Build 13 | 14 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. 15 | 16 | ## Running unit tests 17 | 18 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 19 | 20 | ## Running end-to-end tests 21 | 22 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 23 | Before running the tests make sure you are serving the app via `ng serve`. 24 | 25 | ## Deploying to GitHub Pages 26 | 27 | Run `ng github-pages:deploy` to deploy to GitHub Pages. 28 | 29 | ## Further help 30 | 31 | To get more help on the `angular-cli` use `ng help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 32 | -------------------------------------------------------------------------------- /angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": { 3 | "version": "1.0.0-beta.30", 4 | "name": "tutorial-angular-styling-clarity" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "dist", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.json", 19 | "prefix": "app", 20 | "styles": [ 21 | "../node_modules/clarity-icons/clarity-icons.min.css", 22 | "../node_modules/clarity-ui/clarity-ui.min.css", 23 | "styles.css" 24 | ], 25 | "scripts": [ 26 | "../node_modules/mutationobserver-shim/dist/mutationobserver.min.js", 27 | "../node_modules/@webcomponents/custom-elements/custom-elements.min.js", 28 | "../node_modules/clarity-icons/clarity-icons.min.js" 29 | ], 30 | "environments": { 31 | "source": "environments/environment.ts", 32 | "dev": "environments/environment.ts", 33 | "prod": "environments/environment.prod.ts" 34 | } 35 | } 36 | ], 37 | "e2e": { 38 | "protractor": { 39 | "config": "./protractor.conf.js" 40 | } 41 | }, 42 | "lint": [ 43 | { 44 | "files": "src/**/*.ts", 45 | "project": "src/tsconfig.json" 46 | }, 47 | { 48 | "files": "e2e/**/*.ts", 49 | "project": "e2e/tsconfig.json" 50 | } 51 | ], 52 | "test": { 53 | "karma": { 54 | "config": "./karma.conf.js" 55 | } 56 | }, 57 | "defaults": { 58 | "styleExt": "css", 59 | "prefixInterfaces": false, 60 | "inline": { 61 | "style": false, 62 | "template": false 63 | }, 64 | "spec": { 65 | "class": false, 66 | "component": true, 67 | "directive": true, 68 | "module": false, 69 | "pipe": true, 70 | "service": true 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { TutorialAngularStylingClarityPage } from './app.po'; 2 | 3 | describe('tutorial-angular-styling-clarity App', function() { 4 | let page: TutorialAngularStylingClarityPage; 5 | 6 | beforeEach(() => { 7 | page = new TutorialAngularStylingClarityPage(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class TutorialAngularStylingClarityPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "module": "commonjs", 8 | "moduleResolution": "node", 9 | "outDir": "../dist/out-tsc-e2e", 10 | "sourceMap": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "../node_modules/@types" 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/0.13/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-remap-istanbul'), 12 | require('@angular/cli/plugins/karma') 13 | ], 14 | files: [ 15 | { pattern: './src/test.ts', watched: false } 16 | ], 17 | preprocessors: { 18 | './src/test.ts': ['@angular/cli'] 19 | }, 20 | mime: { 21 | 'text/x-typescript': ['ts','tsx'] 22 | }, 23 | remapIstanbulReporter: { 24 | reports: { 25 | html: 'coverage', 26 | lcovonly: './coverage/coverage.lcov' 27 | } 28 | }, 29 | angularCli: { 30 | config: './angular-cli.json', 31 | environment: 'dev' 32 | }, 33 | reporters: config.angularCli && config.angularCli.codeCoverage 34 | ? ['progress', 'karma-remap-istanbul'] 35 | : ['progress'], 36 | port: 9876, 37 | colors: true, 38 | logLevel: config.LOG_INFO, 39 | autoWatch: true, 40 | browsers: ['Chrome'], 41 | singleRun: false 42 | }); 43 | }; 44 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tutorial-angular-styling-clarity", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "angular-cli": {}, 6 | "scripts": { 7 | "ng": "ng", 8 | "start": "ng serve", 9 | "test": "ng test", 10 | "pree2e": "webdriver-manager update --standalone false --gecko false", 11 | "e2e": "protractor" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/common": "^2.3.1", 16 | "@angular/compiler": "^2.3.1", 17 | "@angular/core": "^2.3.1", 18 | "@angular/forms": "^2.3.1", 19 | "@angular/http": "^2.3.1", 20 | "@angular/platform-browser": "^2.3.1", 21 | "@angular/platform-browser-dynamic": "^2.3.1", 22 | "@angular/router": "^3.3.1", 23 | "core-js": "^2.4.1", 24 | "rxjs": "^5.0.1", 25 | "ts-helpers": "^1.1.1", 26 | "zone.js": "^0.7.2" 27 | }, 28 | "devDependencies": { 29 | "@angular/cli": "1.0.0-beta.30", 30 | "@angular/compiler-cli": "^2.3.1", 31 | "@types/jasmine": "2.5.38", 32 | "@types/node": "^6.0.42", 33 | "@webcomponents/custom-elements": "^1.0.0-alpha.3", 34 | "clarity-angular": "^0.8.5", 35 | "clarity-icons": "^0.8.5", 36 | "clarity-ui": "^0.8.5", 37 | "codelyzer": "~2.0.0-beta.1", 38 | "jasmine-core": "2.5.2", 39 | "jasmine-spec-reporter": "2.5.0", 40 | "karma": "1.2.0", 41 | "karma-chrome-launcher": "^2.0.0", 42 | "karma-cli": "^1.0.1", 43 | "karma-jasmine": "^1.0.2", 44 | "karma-remap-istanbul": "^0.2.1", 45 | "mutationobserver-shim": "^0.3.2", 46 | "protractor": "~4.0.13", 47 | "ts-node": "1.2.1", 48 | "tslint": "^4.3.0", 49 | "typescript": "~2.0.3" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | /*global jasmine */ 5 | var SpecReporter = require('jasmine-spec-reporter'); 6 | 7 | exports.config = { 8 | allScriptsTimeout: 11000, 9 | specs: [ 10 | './e2e/**/*.e2e-spec.ts' 11 | ], 12 | capabilities: { 13 | 'browserName': 'chrome' 14 | }, 15 | directConnect: true, 16 | baseUrl: 'http://localhost:4200/', 17 | framework: 'jasmine', 18 | jasmineNodeOpts: { 19 | showColors: true, 20 | defaultTimeoutInterval: 30000, 21 | print: function() {} 22 | }, 23 | useAllAngular2AppRoots: true, 24 | beforeLaunch: function() { 25 | require('ts-node').register({ 26 | project: 'e2e' 27 | }); 28 | }, 29 | onPrepare: function() { 30 | jasmine.getEnv().addReporter(new SpecReporter()); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | template: ` 6 | 7 | `, 8 | styles: [], 9 | }) 10 | export class AppComponent { 11 | title = 'Project Clarity Rules!'; 12 | } 13 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { HttpModule } from '@angular/http'; 5 | import { ClarityModule } from 'clarity-angular'; 6 | 7 | import { AppComponent } from './app.component'; 8 | import { UiModule } from './ui/ui.module'; 9 | import { AppRoutingModule } from './app.routing'; 10 | import { PagesModule } from './pages/pages.module'; 11 | 12 | @NgModule({ 13 | declarations: [ 14 | AppComponent 15 | ], 16 | imports: [ 17 | BrowserModule, 18 | FormsModule, 19 | HttpModule, 20 | ClarityModule.forRoot(), 21 | UiModule, 22 | PagesModule, 23 | AppRoutingModule, 24 | ], 25 | providers: [], 26 | bootstrap: [AppComponent] 27 | }) 28 | export class AppModule { } 29 | -------------------------------------------------------------------------------- /src/app/app.routing.ts: -------------------------------------------------------------------------------- 1 | 2 | import { NgModule } from '@angular/core'; 3 | import { Routes, RouterModule } from '@angular/router'; 4 | 5 | import { DashboardComponent } from './pages/dashboard/dashboard.component'; 6 | import { PostsComponent } from './pages/posts/posts.component'; 7 | import { SettingsComponent } from './pages/settings/settings.component'; 8 | import { TodosComponent } from './pages/todos/todos.component'; 9 | import { UsersComponent } from './pages/users/users.component'; 10 | 11 | const routes: Routes = [ 12 | { 13 | path: '', 14 | children: [ 15 | { path: '', redirectTo: '/dashboard', pathMatch: 'full' }, 16 | { path: 'dashboard', component: DashboardComponent }, 17 | { path: 'posts', component: PostsComponent }, 18 | { path: 'settings', component: SettingsComponent }, 19 | { path: 'todos', component: TodosComponent }, 20 | { path: 'users', component: UsersComponent }, 21 | ] 22 | } 23 | ]; 24 | 25 | @NgModule({ 26 | imports: [ 27 | RouterModule.forRoot(routes), 28 | ], 29 | exports: [ 30 | RouterModule, 31 | ], 32 | }) 33 | export class AppRoutingModule { } 34 | -------------------------------------------------------------------------------- /src/app/pages/dashboard/dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-dashboard', 5 | template: ` 6 |
7 |
8 |
9 |
10 |

Posts

11 |

12 |
13 | 16 |
17 |
18 |
19 |
20 |
21 |

Todos

22 |

23 |
24 | 27 |
28 |
29 |
30 |
31 |
32 |

Users

33 |

34 |
35 | 38 |
39 |
40 |
41 | `, 42 | styles: [] 43 | }) 44 | export class DashboardComponent implements OnInit { 45 | 46 | constructor() { } 47 | 48 | ngOnInit() { 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/app/pages/data.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | import 'rxjs/add/operator/map' 4 | 5 | export interface User { 6 | id: number; 7 | name: string; 8 | username: string; 9 | email: string; 10 | } 11 | 12 | export interface Post { 13 | id: number; 14 | title: string; 15 | body: string; 16 | } 17 | 18 | export interface Todo { 19 | id: number; 20 | title: string; 21 | completed: boolean; 22 | } 23 | 24 | const baseUrl = 'https://jsonplaceholder.typicode.com'; 25 | 26 | @Injectable() 27 | export class DataService { 28 | 29 | constructor( 30 | private http: Http, 31 | ) { 32 | } 33 | 34 | getUsers() { 35 | return this.http.get(`${baseUrl}/users`).map(res => res.json()) 36 | } 37 | 38 | getPosts() { 39 | return this.http.get(`${baseUrl}/posts`).map(res => res.json()) 40 | } 41 | 42 | getTodos() { 43 | return this.http.get(`${baseUrl}/todos`).map(res => res.json()) 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/app/pages/pages.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { RouterModule } from '@angular/router'; 5 | 6 | import { ClarityModule } from 'clarity-angular'; 7 | 8 | import { DataService } from './data.service'; 9 | 10 | import { DashboardComponent } from './dashboard/dashboard.component'; 11 | import { PostsComponent } from './posts/posts.component'; 12 | import { SettingsComponent } from './settings/settings.component'; 13 | import { TodosComponent } from './todos/todos.component'; 14 | import { UsersComponent } from './users/users.component'; 15 | 16 | const components = [ 17 | DashboardComponent, 18 | PostsComponent, 19 | SettingsComponent, 20 | TodosComponent, 21 | UsersComponent, 22 | ]; 23 | 24 | @NgModule({ 25 | imports: [ 26 | CommonModule, 27 | FormsModule, 28 | RouterModule, 29 | ClarityModule, 30 | ], 31 | declarations: [ 32 | ...components, 33 | ], 34 | exports: [ 35 | ...components, 36 | ], 37 | providers: [ 38 | DataService, 39 | ] 40 | }) 41 | export class PagesModule { } 42 | -------------------------------------------------------------------------------- /src/app/pages/posts/posts.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Observable } from 'rxjs/Observable'; 3 | 4 | import { DataService, Post } from '../data.service'; 5 | 6 | @Component({ 7 | selector: 'app-posts', 8 | template: ` 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 |
Title
18 | {{post.title}} 19 |
23 | 24 | 25 | 28 | 31 | 32 | `, 33 | styles: [` 34 | table { 35 | margin-top: 0; 36 | } 37 | `] 38 | }) 39 | export class PostsComponent { 40 | 41 | posts: Observable; 42 | post: Post; 43 | showModal: boolean = false; 44 | 45 | constructor( 46 | public dataService: DataService, 47 | ) { 48 | this.dataService.getPosts().subscribe(res => this.posts = res); 49 | } 50 | 51 | openModal($event, post) { 52 | $event.preventDefault(); 53 | this.post = post; 54 | this.showModal = true; 55 | } 56 | closeModal() { 57 | this.showModal = false; 58 | this.post = null; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/app/pages/settings/settings.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-settings', 5 | template: ` 6 |
7 |
8 |
9 | 10 |
11 | 12 | 13 |
14 |
15 |
16 |
17 | 18 | 19 |
20 |
21 |
22 |
23 | 24 | 25 |
26 |
27 |
28 |
29 |
30 | 31 |
32 | 33 | 34 |
35 |
36 |
37 | 38 |
39 | 40 | 41 |
42 |
43 |
44 | 45 |
46 | 47 | 48 |
49 |
50 |
51 | 52 |
53 | 54 | 55 |
56 |
57 |
58 | 59 |
60 | 61 |
62 | 63 |
64 | 65 | 66 |
67 |
68 | 69 | 70 |
71 |
72 | 73 | 74 |
75 |
76 | 77 | 78 |
79 |
80 |
81 | 82 |
83 | 84 | 85 |
86 |
87 | 88 | 89 |
90 |
91 | 92 | 93 |
94 |
95 | 96 | 97 |
98 |
99 |
100 |
101 | `, 102 | styles: [] 103 | }) 104 | export class SettingsComponent implements OnInit { 105 | 106 | constructor() { } 107 | 108 | ngOnInit() { 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/app/pages/todos/todos.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Observable } from 'rxjs/Observable'; 3 | 4 | import { DataService, Todo } from '../data.service'; 5 | 6 | @Component({ 7 | selector: 'app-todos', 8 | template: ` 9 | 19 | `, 20 | styles: [] 21 | }) 22 | export class TodosComponent { 23 | 24 | todos: Observable; 25 | 26 | constructor( 27 | public dataService: DataService, 28 | ) { 29 | this.dataService.getTodos().subscribe(res => this.todos = res); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/app/pages/users/users.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Observable } from 'rxjs/Observable'; 3 | 4 | import { DataService, User } from '../data.service'; 5 | 6 | @Component({ 7 | selector: 'app-users', 8 | template: ` 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 26 |
NameUsernameEmail
20 | {{user.name}} 21 | {{user.username}}{{user.email}}
27 | 28 | 29 | 32 | 35 | 36 | `, 37 | styles: [` 38 | table { 39 | margin-top: 0; 40 | } 41 | `] 42 | }) 43 | export class UsersComponent { 44 | 45 | users: Observable; 46 | user: User; 47 | showModal: boolean = false; 48 | 49 | constructor( 50 | public dataService: DataService, 51 | ) { 52 | this.dataService.getUsers().subscribe(res => this.users = res); 53 | } 54 | 55 | openModal($event, user) { 56 | $event.preventDefault(); 57 | this.user = user; 58 | this.showModal = true; 59 | } 60 | closeModal() { 61 | this.showModal = false; 62 | this.user = null; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/app/ui/layout/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | template: ` 6 |
7 | 13 |
14 | 15 | 16 | 17 |
18 | 23 |
24 | 25 | 29 | 34 | 35 |
36 |
37 | 44 | `, 45 | styles: [] 46 | }) 47 | export class HeaderComponent { 48 | 49 | headerLinks = [ 50 | { link: ['/', 'dashboard'], icon: 'home'}, 51 | { link: ['/', 'settings'], icon: 'cog'}, 52 | ]; 53 | 54 | subLinks = [ 55 | { link : ['/', 'dashboard'], label: 'Dashboard' }, 56 | { link : ['/', 'posts'], label: 'Posts' }, 57 | { link : ['/', 'todos'], label: 'Todos' }, 58 | { link : ['/', 'users'], label: 'Users' }, 59 | ]; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/app/ui/layout/layout.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-layout', 5 | template: ` 6 |
7 | 8 | 9 | 10 | 11 |
12 | `, 13 | styles: [] 14 | }) 15 | export class LayoutComponent { } 16 | -------------------------------------------------------------------------------- /src/app/ui/layout/main/main.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-main', 5 | template: ` 6 |
7 |
8 | 9 |
10 | 11 |
12 | `, 13 | styles: [] 14 | }) 15 | export class MainComponent { } 16 | -------------------------------------------------------------------------------- /src/app/ui/layout/sidebar/sidebar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-sidebar', 5 | template: ` 6 | 27 | `, 28 | styles: [] 29 | }) 30 | export class SidebarComponent implements OnInit { 31 | 32 | constructor() { } 33 | 34 | ngOnInit() { 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/app/ui/ui.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule } from '@angular/router'; 4 | 5 | import { ClarityModule } from 'clarity-angular'; 6 | 7 | import { LayoutComponent } from './layout/layout.component'; 8 | import { HeaderComponent } from './layout/header/header.component'; 9 | import { SidebarComponent } from './layout/sidebar/sidebar.component'; 10 | import { MainComponent } from './layout/main/main.component'; 11 | 12 | @NgModule({ 13 | imports: [ 14 | CommonModule, 15 | RouterModule, 16 | ClarityModule, 17 | ], 18 | declarations: [ 19 | LayoutComponent, 20 | HeaderComponent, 21 | SidebarComponent, 22 | MainComponent, 23 | ], 24 | exports: [ 25 | LayoutComponent, 26 | ] 27 | }) 28 | export class UiModule { } 29 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beeman/tutorial-angular-styling-clarity/dc9b0c30d3380161d5426beddd3ecf3f3f5e96e8/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beeman/tutorial-angular-styling-clarity/dc9b0c30d3380161d5426beddd3ecf3f3f5e96e8/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TutorialAngularStylingClarity 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | import { enableProdMode } from '@angular/core'; 3 | import { environment } from './environments/environment'; 4 | import { AppModule } from './app/app.module'; 5 | 6 | if (environment.production) { 7 | enableProdMode(); 8 | } 9 | 10 | platformBrowserDynamic().bootstrapModule(AppModule); 11 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | // This file includes polyfills needed by Angular and is loaded before the app. 2 | // You can add your own extra polyfills to this file. 3 | import 'core-js/es6/symbol'; 4 | import 'core-js/es6/object'; 5 | import 'core-js/es6/function'; 6 | import 'core-js/es6/parse-int'; 7 | import 'core-js/es6/parse-float'; 8 | import 'core-js/es6/number'; 9 | import 'core-js/es6/math'; 10 | import 'core-js/es6/string'; 11 | import 'core-js/es6/date'; 12 | import 'core-js/es6/array'; 13 | import 'core-js/es6/regexp'; 14 | import 'core-js/es6/map'; 15 | import 'core-js/es6/set'; 16 | import 'core-js/es6/reflect'; 17 | 18 | import 'core-js/es7/reflect'; 19 | import 'zone.js/dist/zone'; 20 | 21 | // If you need to support the browsers/features below, uncomment the import 22 | // and run `npm install import-name-here'; 23 | // Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 24 | 25 | // Needed for: IE9 26 | // import 'classlist.js'; 27 | 28 | // Animations 29 | // Needed for: All but Chrome and Firefox, Not supported in IE9 30 | // import 'web-animations-js'; 31 | 32 | // Date, currency, decimal and percent pipes 33 | // Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 34 | // import 'intl'; 35 | 36 | // NgClass on SVG elements 37 | // Needed for: IE10, IE11 38 | // import 'classlist.js'; 39 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare var __karma__: any; 17 | declare var require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "", 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": ["es6", "dom"], 8 | "mapRoot": "./", 9 | "module": "es6", 10 | "moduleResolution": "node", 11 | "outDir": "../dist/out-tsc", 12 | "sourceMap": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "../node_modules/@types" 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "callable-types": true, 7 | "class-name": true, 8 | "comment-format": [ 9 | true, 10 | "check-space" 11 | ], 12 | "curly": true, 13 | "eofline": true, 14 | "forin": true, 15 | "import-blacklist": [true, "rxjs"], 16 | "import-spacing": true, 17 | "indent": [ 18 | true, 19 | "spaces" 20 | ], 21 | "interface-over-type-literal": true, 22 | "label-position": true, 23 | "max-line-length": [ 24 | true, 25 | 140 26 | ], 27 | "member-access": false, 28 | "member-ordering": [ 29 | true, 30 | "static-before-instance", 31 | "variables-before-functions" 32 | ], 33 | "no-arg": true, 34 | "no-bitwise": true, 35 | "no-console": [ 36 | true, 37 | "debug", 38 | "info", 39 | "time", 40 | "timeEnd", 41 | "trace" 42 | ], 43 | "no-construct": true, 44 | "no-debugger": true, 45 | "no-duplicate-variable": true, 46 | "no-empty": false, 47 | "no-empty-interface": true, 48 | "no-eval": true, 49 | "no-inferrable-types": true, 50 | "no-shadowed-variable": true, 51 | "no-string-literal": false, 52 | "no-string-throw": true, 53 | "no-switch-case-fall-through": true, 54 | "no-trailing-whitespace": true, 55 | "no-unused-expression": true, 56 | "no-use-before-declare": true, 57 | "no-var-keyword": true, 58 | "object-literal-sort-keys": false, 59 | "one-line": [ 60 | true, 61 | "check-open-brace", 62 | "check-catch", 63 | "check-else", 64 | "check-whitespace" 65 | ], 66 | "prefer-const": true, 67 | "quotemark": [ 68 | true, 69 | "single" 70 | ], 71 | "radix": true, 72 | "semicolon": [ 73 | "always" 74 | ], 75 | "triple-equals": [ 76 | true, 77 | "allow-null-check" 78 | ], 79 | "typedef-whitespace": [ 80 | true, 81 | { 82 | "call-signature": "nospace", 83 | "index-signature": "nospace", 84 | "parameter": "nospace", 85 | "property-declaration": "nospace", 86 | "variable-declaration": "nospace" 87 | } 88 | ], 89 | "typeof-compare": true, 90 | "unified-signatures": true, 91 | "variable-name": false, 92 | "whitespace": [ 93 | true, 94 | "check-branch", 95 | "check-decl", 96 | "check-operator", 97 | "check-separator", 98 | "check-type" 99 | ], 100 | 101 | "directive-selector": [true, "attribute", "app", "camelCase"], 102 | "component-selector": [true, "element", "app", "kebab-case"], 103 | "use-input-property-decorator": true, 104 | "use-output-property-decorator": true, 105 | "use-host-property-decorator": true, 106 | "no-input-rename": true, 107 | "no-output-rename": true, 108 | "use-life-cycle-interface": true, 109 | "use-pipe-transform-interface": true, 110 | "component-class-suffix": true, 111 | "directive-class-suffix": true, 112 | "no-access-missing-member": true, 113 | "templates-use-public": true, 114 | "invoke-injectable": true 115 | } 116 | } 117 | --------------------------------------------------------------------------------