Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions aio/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
<div id="top-of-page"></div>

<div *ngIf="isFetching" class="progress-bar-container">
<md-progress-bar mode="indeterminate" color="warn"></md-progress-bar>
<mat-progress-bar mode="indeterminate" color="warn"></mat-progress-bar>
</div>

<md-toolbar color="primary" class="app-toolbar">
<button class="hamburger" [class.starting]="isStarting" md-button
<mat-toolbar color="primary" class="app-toolbar">
<button class="hamburger" [class.starting]="isStarting" mat-button
(click)="sidenav.toggle()" title="Docs menu">
<md-icon [ngClass]="{'sidenav-open': !isSideBySide }" svgIcon="menu"></md-icon>
<mat-icon [ngClass]="{'sidenav-open': !isSideBySide }" svgIcon="menu"></mat-icon>
</button>
<a class="nav-link home" href="/"><img src="{{ homeImageUrl }}" title="Home" alt="Home"></a>
<aio-top-menu *ngIf="isSideBySide" [nodes]="topMenuNodes"></aio-top-menu>
<aio-search-box class="search-container" #searchBox (onSearch)="doSearch($event)" (onFocus)="doSearch($event)"></aio-search-box>
</md-toolbar>
</mat-toolbar>
<aio-search-results #searchResultsView *ngIf="showSearchResults" [searchResults]="searchResults | async" (resultSelected)="hideSearchResults()"></aio-search-results>

<md-sidenav-container class="sidenav-container" [class.starting]="isStarting" [class.has-floating-toc]="hasFloatingToc" role="main">
<mat-sidenav-container class="sidenav-container" [class.starting]="isStarting" [class.has-floating-toc]="hasFloatingToc" role="main">

<md-sidenav [ngClass]="{'collapsed': !isSideBySide }" #sidenav class="sidenav" [opened]="isOpened" [mode]="mode" (open)="updateHostClasses()" (close)="updateHostClasses()">
<mat-sidenav [ngClass]="{'collapsed': !isSideBySide }" #sidenav class="sidenav" [opened]="isOpened" [mode]="mode" (open)="updateHostClasses()" (close)="updateHostClasses()">
<aio-nav-menu *ngIf="!isSideBySide" [nodes]="topMenuNarrowNodes" [currentNode]="currentNodes?.TopBarNarrow" [isWide]="false"></aio-nav-menu>
<aio-nav-menu [nodes]="sideNavNodes" [currentNode]="currentNodes?.SideNav" [isWide]="isSideBySide"></aio-nav-menu>

<div class="doc-version">
<aio-select (change)="onDocVersionChange($event.index)" [options]="docVersions" [selected]="currentDocVersion"></aio-select>
</div>
</md-sidenav>
</mat-sidenav>

<section class="sidenav-content" [id]="pageId" role="content">
<aio-mode-banner [mode]="deployment.mode" [version]="versionInfo"></aio-mode-banner>
<aio-doc-viewer [doc]="currentDocument" (docRendered)="onDocRendered()"></aio-doc-viewer>
<aio-dt [on]="dtOn" [(doc)]="currentDocument"></aio-dt>
</section>

</md-sidenav-container>
</mat-sidenav-container>

<div *ngIf="hasFloatingToc" class="toc-container" [style.max-height.px]="tocMaxHeight" (mousewheel)="restrainScrolling($event)">
<aio-toc></aio-toc>
Expand Down
10 changes: 5 additions & 5 deletions aio/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { inject, ComponentFixture, TestBed, fakeAsync, tick } from '@angular/cor
import { Title } from '@angular/platform-browser';
import { APP_BASE_HREF } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { MdProgressBar, MdSidenav } from '@angular/material';
import { MatProgressBar, MatSidenav } from '@angular/material';
import { By } from '@angular/platform-browser';

import { of } from 'rxjs/observable/of';
Expand Down Expand Up @@ -51,7 +51,7 @@ describe('AppComponent', () => {
docViewer = de.query(By.css('aio-doc-viewer')).nativeElement;
hamburger = de.query(By.css('.hamburger')).nativeElement;
locationService = de.injector.get(LocationService) as any as MockLocationService;
sidenav = de.query(By.css('md-sidenav')).nativeElement;
sidenav = de.query(By.css('mat-sidenav')).nativeElement;
tocService = de.injector.get(TocService);
};

Expand Down Expand Up @@ -376,7 +376,7 @@ describe('AppComponent', () => {
});

it('should set the css class of the host container based on the open/closed state of the side nav', () => {
const sideNav = fixture.debugElement.query(By.directive(MdSidenav));
const sideNav = fixture.debugElement.query(By.directive(MatSidenav));

locationService.go('guide/pipes');
fixture.detectChanges();
Expand Down Expand Up @@ -882,7 +882,7 @@ describe('AppComponent', () => {

describe('initial rendering', () => {
it('should initially add the starting class until the first document is rendered', fakeAsync(() => {
const getSidenavContainer = () => fixture.debugElement.query(By.css('md-sidenav-container'));
const getSidenavContainer = () => fixture.debugElement.query(By.css('mat-sidenav-container'));

initializeTest();

Expand All @@ -909,7 +909,7 @@ describe('AppComponent', () => {
describe('progress bar', () => {
const SHOW_DELAY = 200;
const HIDE_DELAY = 500;
const getProgressBar = () => fixture.debugElement.query(By.directive(MdProgressBar));
const getProgressBar = () => fixture.debugElement.query(By.directive(MatProgressBar));
const initializeAndCompleteNavigation = () => {
initializeTest();
triggerDocRendered();
Expand Down
10 changes: 5 additions & 5 deletions aio/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, ElementRef, HostBinding, HostListener, OnInit,
QueryList, ViewChild, ViewChildren } from '@angular/core';
import { MdSidenav } from '@angular/material';
import { MatSidenav } from '@angular/material';

import { CurrentNodes, NavigationService, NavigationNode, VersionInfo } from 'app/navigation/navigation.service';
import { DocumentService, DocumentContents } from 'app/documents/document.service';
Expand Down Expand Up @@ -95,8 +95,8 @@ export class AppComponent implements OnInit {
@ViewChild(SearchBoxComponent)
searchBox: SearchBoxComponent;

@ViewChild(MdSidenav)
sidenav: MdSidenav;
@ViewChild(MatSidenav)
sidenav: MatSidenav;

constructor(
public deployment: Deployment,
Expand Down Expand Up @@ -287,11 +287,11 @@ export class AppComponent implements OnInit {
@HostListener('window:scroll')
onScroll() {
if (!this.tocMaxHeightOffset) {
// Must wait until now for md-toolbar to be measurable.
// Must wait until now for mat-toolbar to be measurable.
const el = this.hostElement.nativeElement as Element;
this.tocMaxHeightOffset =
el.querySelector('footer').clientHeight +
el.querySelector('md-toolbar.app-toolbar').clientHeight +
el.querySelector('mat-toolbar.app-toolbar').clientHeight +
24; // fudge margin
}

Expand Down
40 changes: 19 additions & 21 deletions aio/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { Location, LocationStrategy, PathLocationStrategy } from '@angular/common';

import {
MdButtonModule,
MdIconModule,
MdIconRegistry,
MdInputModule,
MdProgressBarModule,
MdSidenavModule,
MdTabsModule,
MdToolbarModule,
Platform
MatButtonModule,
MatIconModule,
MatIconRegistry,
MatInputModule,
MatProgressBarModule,
MatSidenavModule,
MatTabsModule,
MatToolbarModule,
} from '@angular/material';

// Temporary fix for MdSidenavModule issue:
// Temporary fix for MatSidenavModule issue:
// crashes with "missing first" operator when SideNav.mode is "over"
import 'rxjs/add/operator/first';

import { SwUpdatesModule } from 'app/sw-updates/sw-updates.module';

import { AppComponent } from 'app/app.component';
import { ApiService } from 'app/embedded/api/api.service';
import { CustomMdIconRegistry, SVG_ICONS } from 'app/shared/custom-md-icon-registry';
import { CustomMatIconRegistry, SVG_ICONS } from 'app/shared/custom-icon-registry';
import { Deployment } from 'app/shared/deployment.service';
import { DocViewerComponent } from 'app/layout/doc-viewer/doc-viewer.component';
import { DtComponent } from 'app/layout/doc-viewer/dt.component';
Expand All @@ -48,7 +47,7 @@ import { TocService } from 'app/shared/toc.service';

import { SharedModule } from 'app/shared/shared.module';

// These are the hardcoded inline svg sources to be used by the `<md-icon>` component
// These are the hardcoded inline svg sources to be used by the `<mat-icon>` component
export const svgIconProviders = [
{
provide: SVG_ICONS,
Expand Down Expand Up @@ -76,13 +75,13 @@ export const svgIconProviders = [
EmbeddedModule,
HttpClientModule,
BrowserAnimationsModule,
MdButtonModule,
MdIconModule,
MdInputModule,
MdProgressBarModule,
MdSidenavModule,
MdTabsModule,
MdToolbarModule,
MatButtonModule,
MatIconModule,
MatInputModule,
MatProgressBarModule,
MatSidenavModule,
MatTabsModule,
MatToolbarModule,
SwUpdatesModule,
SharedModule
],
Expand All @@ -106,9 +105,8 @@ export const svgIconProviders = [
Location,
{ provide: LocationStrategy, useClass: PathLocationStrategy },
LocationService,
{ provide: MdIconRegistry, useClass: CustomMdIconRegistry },
{ provide: MatIconRegistry, useClass: CustomMatIconRegistry },
NavigationService,
Platform,
ScrollService,
ScrollSpyService,
SearchService,
Expand Down
6 changes: 3 additions & 3 deletions aio/src/app/embedded/code/code-tabs.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { Component, DebugElement, Input, NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MdTabGroup, MdTabsModule } from '@angular/material';
import { MatTabGroup, MatTabsModule } from '@angular/material';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

Expand Down Expand Up @@ -50,7 +50,7 @@ describe('CodeTabsComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ MdTabsModule, NoopAnimationsModule ]
imports: [ MatTabsModule, NoopAnimationsModule ]
});
});

Expand Down Expand Up @@ -86,7 +86,7 @@ describe('CodeTabsComponent', () => {

it('should disable ripple effect on tab labels', () => {
createComponent();
const tabsGroupComponent = codeTabsDe.query(By.directive(MdTabGroup)).componentInstance;
const tabsGroupComponent = codeTabsDe.query(By.directive(MatTabGroup)).componentInstance;

expect(tabsGroupComponent.disableRipple).toBe(true);
});
Expand Down
10 changes: 5 additions & 5 deletions aio/src/app/embedded/code/code-tabs.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export interface TabInfo {
@Component({
selector: 'code-tabs',
template: `
<md-tab-group class="code-tab-group" disableRipple>
<md-tab style="overflow-y: hidden;" *ngFor="let tab of tabs">
<ng-template md-tab-label>
<mat-tab-group class="code-tab-group" disableRipple>
<mat-tab style="overflow-y: hidden;" *ngFor="let tab of tabs">
<ng-template mat-tab-label>
<span class="{{ tab.class }}">{{ tab.title }}</span>
</ng-template>
<aio-code class="{{ tab.class }}"
Expand All @@ -34,8 +34,8 @@ export interface TabInfo {
[region]="tab.region"
[title]="tab.title">
</aio-code>
</md-tab>
</md-tab-group>
</mat-tab>
</mat-tab-group>
`
})
export class CodeTabsComponent implements OnInit {
Expand Down
10 changes: 5 additions & 5 deletions aio/src/app/embedded/code/code.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, DebugElement } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MdSnackBarModule, MdSnackBar } from '@angular/material';
import { MatSnackBarModule, MatSnackBar } from '@angular/material';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

Expand Down Expand Up @@ -42,7 +42,7 @@ describe('CodeComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ MdSnackBarModule, NoopAnimationsModule ],
imports: [ MatSnackBarModule, NoopAnimationsModule ],
declarations: [ CodeComponent, HostComponent ],
providers: [
PrettyPrinter,
Expand Down Expand Up @@ -243,7 +243,7 @@ describe('CodeComponent', () => {
});

it('should display a message when copy succeeds', () => {
const snackBar: MdSnackBar = TestBed.get(MdSnackBar);
const snackBar: MatSnackBar = TestBed.get(MatSnackBar);
const copierService: CopierService = TestBed.get(CopierService);
spyOn(snackBar, 'open');
spyOn(copierService, 'copyText').and.returnValue(true);
Expand All @@ -252,7 +252,7 @@ describe('CodeComponent', () => {
});

it('should display an error when copy fails', () => {
const snackBar: MdSnackBar = TestBed.get(MdSnackBar);
const snackBar: MatSnackBar = TestBed.get(MatSnackBar);
const copierService: CopierService = TestBed.get(CopierService);
spyOn(snackBar, 'open');
spyOn(copierService, 'copyText').and.returnValue(false);
Expand All @@ -267,7 +267,7 @@ describe('CodeComponent', () => {
@Component({
selector: 'aio-host-comp',
template: `
<aio-code md-no-ink [code]="code" [language]="language"
<aio-code mat-no-ink [code]="code" [language]="language"
[linenums]="linenums" [path]="path" [region]="region"
[hideCopy]="hideCopy" [title]="title"></aio-code>
`
Expand Down
4 changes: 2 additions & 2 deletions aio/src/app/embedded/code/code.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, ElementRef, ViewChild, OnChanges, Input } from '@angular/cor
import { Logger } from 'app/shared/logger.service';
import { PrettyPrinter } from './pretty-printer.service';
import { CopierService } from 'app/shared/copier.service';
import { MdSnackBar } from '@angular/material';
import { MatSnackBar } from '@angular/material';

const defaultLineNumsCount = 10; // by default, show linenums over this number

Expand Down Expand Up @@ -100,7 +100,7 @@ export class CodeComponent implements OnChanges {
@ViewChild('codeContainer') codeContainer: ElementRef;

constructor(
private snackbar: MdSnackBar,
private snackbar: MatSnackBar,
private pretty: PrettyPrinter,
private copier: CopierService,
private logger: Logger) {}
Expand Down
6 changes: 3 additions & 3 deletions aio/src/app/embedded/contributor/contributor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import { CONTENT_URL_PREFIX } from 'app/documents/document.service';

<div class="contributor-image" [style.background-image]="'url('+pictureBase+(person.picture || noPicture)+')'">
<div class="contributor-info">
<a *ngIf="person.bio" md-button>
<a *ngIf="person.bio" mat-button>
View Bio
</a>
<a *ngIf="person.twitter" md-button class="icon"
<a *ngIf="person.twitter" mat-button class="icon"
href="https://twitter.com/{{person.twitter}}" target="_blank" (click)="$event.stopPropagation()">
<span class="fa fa-twitter fa-2x"></span>
</a>
<a *ngIf="person.website" md-button class="icon"
<a *ngIf="person.website" mat-button class="icon"
href="{{person.website}}" target="_blank" (click)="$event.stopPropagation()">
<span class="fa fa-link fa-2x"></span>
</a>
Expand Down
8 changes: 4 additions & 4 deletions aio/src/app/embedded/embedded.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { PrettyPrinter } from './code/pretty-printer.service';
// It is not enough just to import them inside the AppModule

// Reusable components (used inside embedded components)
import { MdIconModule, MdSnackBarModule, MdTabsModule } from '@angular/material';
import { MatIconModule, MatSnackBarModule, MatTabsModule } from '@angular/material';
import { CodeComponent } from './code/code.component';
import { SharedModule } from 'app/shared/shared.module';

Expand Down Expand Up @@ -43,9 +43,9 @@ export class EmbeddedComponents {
@NgModule({
imports: [
CommonModule,
MdIconModule,
MdSnackBarModule,
MdTabsModule,
MatIconModule,
MatSnackBarModule,
MatTabsModule,
SharedModule
],
declarations: [
Expand Down
2 changes: 1 addition & 1 deletion aio/src/app/embedded/toc/toc.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
aria-label="Expand/collapse contents"
[attr.aria-pressed]="!isCollapsed">
Contents
<md-icon class="rotating-icon" svgIcon="keyboard_arrow_right" [class.collapsed]="isCollapsed"></md-icon>
<mat-icon class="rotating-icon" svgIcon="keyboard_arrow_right" [class.collapsed]="isCollapsed"></mat-icon>
</button>

<ul class="toc-list" [class.embedded]="type !== 'Floating'">
Expand Down
4 changes: 2 additions & 2 deletions aio/src/app/layout/nav-item/nav-item.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<a *ngIf="node.url != null" href="{{node.url}}" [ngClass]="classes" title="{{node.tooltip}}"
(click)="headerClicked()" class="vertical-menu-item heading">
{{node.title}}
<md-icon class="rotating-icon" svgIcon="keyboard_arrow_right"></md-icon>
<mat-icon class="rotating-icon" svgIcon="keyboard_arrow_right"></mat-icon>
</a>

<button *ngIf="node.url == null" type="button" [ngClass]="classes" title="{{node.tooltip}}"
(click)="headerClicked()" class="vertical-menu-item heading"
[attr.aria-pressed]="isExpanded">
{{node.title}}
<md-icon class="rotating-icon" svgIcon="keyboard_arrow_right"></md-icon>
<mat-icon class="rotating-icon" svgIcon="keyboard_arrow_right"></mat-icon>
</button>

<div class="heading-children" [ngClass]="classes">
Expand Down
Loading