Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

Commit

Permalink
chore: cleanup and ng format
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed May 22, 2016
1 parent 3a02410 commit 7d3ad67
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {beforeEach, beforeEachProviders, describe, expect, it, inject} from '@angular/core/testing';
import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
import {Component} from '@angular/core';
import {beforeEach, beforeEachProviders, describe, expect, it, inject} from '@angular/core/testing';
import {By} from '@angular/platform-browser';

import {ComponentsComponent} from './components.component';

describe('Component: Components', () => {
Expand Down
3 changes: 2 additions & 1 deletion modules/docs/src/app/+components/components.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {Component} from '@angular/core';
import {OnActivate, RouteSegment, ROUTER_DIRECTIVES} from '@angular/router';
import {ComponentsService, IComponentMeta, NavigationService, ExampleComponent} from '../shared';
import {MATERIAL_DIRECTIVES} from 'ng2-material';

import {ComponentsService, IComponentMeta, NavigationService, ExampleComponent} from '../shared';
import {HighlightComponent} from '../shared/highlight/highlight.component';


Expand Down
3 changes: 2 additions & 1 deletion modules/docs/src/app/+index/index.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {beforeEach, beforeEachProviders, describe, expect, it, inject} from '@angular/core/testing';
import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
import {Component} from '@angular/core';
import {beforeEach, beforeEachProviders, describe, expect, it, inject} from '@angular/core/testing';
import {By} from '@angular/platform-browser';

import {IndexComponent} from './index.component';

describe('Component: Index', () => {
Expand Down
3 changes: 2 additions & 1 deletion modules/docs/src/app/+index/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Component, OnInit} from '@angular/core';
import {MATERIAL_DIRECTIVES} from 'ng2-material';
import {ROUTER_DIRECTIVES} from '@angular/router';
import {MATERIAL_DIRECTIVES} from 'ng2-material';

import {ComponentsService, HighlightComponent} from '../shared';


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component} from '@angular/core';
import {MATERIAL_DIRECTIVES, ITableSelectionChange} from 'ng2-material';
import {MdToolbar} from '@angular2-material/toolbar';
import {MATERIAL_DIRECTIVES, ITableSelectionChange} from 'ng2-material';

@Component({
moduleId: module.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Component} from '@angular/core';
import {MATERIAL_DIRECTIVES} from 'ng2-material';
import {FORM_DIRECTIVES} from '@angular/common';
import {Component} from '@angular/core';
import {MD_INPUT_DIRECTIVES} from '@angular2-material/input';
import {MdToolbar} from '@angular2-material/toolbar';
import {MATERIAL_DIRECTIVES} from 'ng2-material';

@Component({
moduleId: module.id,
Expand Down
6 changes: 4 additions & 2 deletions modules/docs/src/app/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import {ButtonBasicUsageComponent} from './examples/button/button-basic-usage.component';
import {ElevationBasicUsageComponent} from './examples/elevation/elevation-basic-usage.component';
import {ComponentsService, NavigationService, VersionService} from './shared';
import {CardActionButtonsComponent} from './examples/card/card-action-buttons.component';
import {CardBasicUsageComponent} from './examples/card/card-basic-usage.component';
import {CardInlineActionsComponent} from './examples/card/card-inline-actions.component';
import {CheckboxBasicUsageComponent} from './examples/checkbox/checkbox-basic-usage.component';
import {DataTableBasicUsageComponent} from './examples/data-table/data-table-basic-usage.component';
import {DataTableSelectableRowsComponent} from './examples/data-table/data-table-selectable-rows.component';
import {DialogBasicUsageComponent} from './examples/dialog/dialog-basic-usage.component';
import {ElevationBasicUsageComponent} from './examples/elevation/elevation-basic-usage.component';
import {InputBasicUsageComponent} from './examples/input/input-basic-usage.component';
import {ListBasicUsageComponent} from './examples/list/list-basic-usage.component';
import {ProgressBarBasicUsageComponent} from './examples/progress-bar/progress-bar-basic-usage.component';
Expand All @@ -18,9 +17,12 @@ import {SwitchBasicUsageComponent} from './examples/switch/switch-basic-usage.co
import {TabsDynamicHeightComponent} from './examples/tabs/tabs-dynamic-height.component';
import {TabsDynamicTabsComponent} from './examples/tabs/tabs-dynamic-tabs.component';
import {ToolbarBasicUsageComponent} from './examples/toolbar/toolbar-basic-usage.component';
import {ComponentsService, NavigationService, VersionService} from './shared';

export {environment} from './environment';
export {SiteAppComponent} from './site.component';


/**
* Collection of Material Design component example directives.
*/
Expand Down
3 changes: 2 additions & 1 deletion modules/docs/src/app/shared/example/example.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {Component, Input, DynamicComponentLoader, ComponentRef, Query, QueryList, ViewContainerRef, AfterViewInit, ViewChild} from '@angular/core';
import {MATERIAL_DIRECTIVES, MdTabs} from 'ng2-material';
import {Http} from '@angular/http';
import {MdToolbar} from '@angular2-material/toolbar';
import {MATERIAL_DIRECTIVES, MdTabs} from 'ng2-material';

import {IExampleData, DEMO_DIRECTIVES} from '../../index';
import {HighlightComponent} from '../highlight/highlight.component';

Expand Down
3 changes: 2 additions & 1 deletion modules/docs/src/app/shared/footer/footer.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {Component, OnInit} from '@angular/core';
import {ROUTER_DIRECTIVES} from '@angular/router';
import {MATERIAL_DIRECTIVES} from 'ng2-material';
import {MdToolbar} from '@angular2-material/toolbar';
import {MATERIAL_DIRECTIVES} from 'ng2-material';

import {NavigationService} from '../navigation.service';

@Component({
Expand Down
3 changes: 2 additions & 1 deletion modules/docs/src/app/shared/highlight/highlight.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ declare var hljs: any;
moduleId: module.id,
selector: 'docs-highlight',
styleUrls: ['highlight.component.css'],
template: `<pre><code class="highlight" [innerHtml]="rendered || text"><ng-content></ng-content></code></pre>`
template:
`<pre><code class="highlight" [innerHtml]="rendered || text"><ng-content></ng-content></code></pre>`
})
export class HighlightComponent implements AfterContentInit {
get type(): string { return this._type; }
Expand Down
40 changes: 16 additions & 24 deletions modules/docs/src/app/site.component.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import {Component, OnInit, OnDestroy, Input, ViewChild, AfterViewInit} from '@angular/core';
import {IndexComponent} from './+index';
import {Response, Http} from '@angular/http';
import {Routes, ROUTER_DIRECTIVES} from '@angular/router';
import {ComponentsComponent} from './+components';
import {MATERIAL_DIRECTIVES, Media} from 'ng2-material';
import {NavigationService} from './shared/navigation.service';
import {Router} from '@angular/router';
import {MD_SIDENAV_DIRECTIVES, MdSidenav} from '@angular2-material/sidenav';
import {MdToolbar} from '@angular2-material/toolbar';
import {MATERIAL_DIRECTIVES, Media} from 'ng2-material';
import {MdIcon} from 'ng2-material';

import {ComponentsComponent} from './+components';
import {IndexComponent} from './+index';
import {ComponentsService, IComponentMeta} from './shared/components.service';
import {Response, Http} from '@angular/http';
import {Router} from '@angular/router';
import {FooterComponent} from './shared/footer/footer.component';
import {MdIcon} from 'ng2-material';
import {NavigationService} from './shared/navigation.service';
import {ComponentsOrderByPipe} from './site.pipe';

@Component({
Expand All @@ -29,7 +30,7 @@ import {ComponentsOrderByPipe} from './site.pipe';
{path: '/components/:id', component: ComponentsComponent}
])
export class SiteAppComponent implements OnInit,
OnDestroy, AfterViewInit {
OnDestroy, AfterViewInit {
static SIDE_MENU_BREAKPOINT: string = 'gt-md';

@ViewChild(MdSidenav) private menu: MdSidenav;
Expand All @@ -48,10 +49,9 @@ export class SiteAppComponent implements OnInit,

private _subscription = null;

constructor(private http: Http, private navigation: NavigationService, private media: Media,
private router: Router,
private _components: ComponentsService) {
}
constructor(
private http: Http, private navigation: NavigationService, private media: Media,
private router: Router, private _components: ComponentsService) {}

ngAfterViewInit(): any {
let query = Media.getQuery(SiteAppComponent.SIDE_MENU_BREAKPOINT);
Expand All @@ -61,23 +61,17 @@ export class SiteAppComponent implements OnInit,
});
}

get pushed(): boolean {
return this.menu && this.menu.mode === 'side';
}
get pushed(): boolean { return this.menu && this.menu.mode === 'side'; }

get over(): boolean {
return this.menu && this.menu.mode === 'over' && this.menu.opened;
}
get over(): boolean { return this.menu && this.menu.mode === 'over' && this.menu.opened; }

// TODO(jd): these two property hacks are to work around issues with the peekaboo fixed nav
// overlapping the sidenav and toolbar. They will not properly "fix" to the top if inside
// md-sidenav-layout, and they will overlap the sidenav and scrollbar when outside. So just
// calculate left and right properties for fixed toolbars based on the media query and browser
// scrollbar width. :sob: :rage:
@Input()
get sidenavWidth(): number {
return this.pushed ? 281 : 0;
}
get sidenavWidth(): number { return this.pushed ? 281 : 0; }

@Input()
get scrollWidth(): number {
Expand Down Expand Up @@ -124,7 +118,5 @@ export class SiteAppComponent implements OnInit,
}


ngOnDestroy(): any {
this._subscription.unsubscribe();
}
ngOnDestroy(): any { this._subscription.unsubscribe(); }
}
4 changes: 1 addition & 3 deletions modules/docs/src/app/site.pipe.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {Pipe} from '@angular/core';

@Pipe({
name: 'componentOrder'
})
@Pipe({name: 'componentOrder'})
export class ComponentsOrderByPipe {
transform(array: Array<string>, args: string): Array<string> {
array.sort((a: any, b: any): number => {
Expand Down
9 changes: 5 additions & 4 deletions modules/docs/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {bootstrap} from '@angular/platform-browser-dynamic';
import {provide, enableProdMode} from '@angular/core';
import {SiteAppComponent, environment, DEMO_PROVIDERS} from './app/index';
import {LocationStrategy, HashLocationStrategy} from '@angular/common';
import {ROUTER_PROVIDERS} from '@angular/router';
import {provide, enableProdMode} from '@angular/core';
import {HTTP_PROVIDERS} from '@angular/http';
import {bootstrap} from '@angular/platform-browser-dynamic';
import {ROUTER_PROVIDERS} from '@angular/router';
import {MATERIAL_BROWSER_PROVIDERS} from 'ng2-material';

import {SiteAppComponent, environment, DEMO_PROVIDERS} from './app/index';


enableProdMode();
if (environment.production) {
Expand Down

0 comments on commit 7d3ad67

Please sign in to comment.