refactor(aio): remove unnecessary comments/imports, improve indentation

This commit is contained in:
Georgios Kalpakas 2017-07-11 00:37:28 +03:00 committed by Igor Minar
parent b9525ece77
commit aec39c28d8
3 changed files with 26 additions and 24 deletions

View File

@ -1,7 +1,6 @@
/* tslint:disable:no-unused-variable */ import { Component, DebugElement, Input } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
import { Component, DebugElement, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
import { CodeExampleComponent } from './code-example.component'; import { CodeExampleComponent } from './code-example.component';
@ -75,13 +74,12 @@ describe('CodeExampleComponent', () => {
}); });
//// Test helpers //// //// Test helpers ////
// tslint:disable:member-ordering
@Component({ @Component({
selector: 'aio-code', selector: 'aio-code',
template: ` template: `
<div>lang: {{language}}</div> <div>lang: {{language}}</div>
<div>linenums: {{linenums}}</div> <div>linenums: {{linenums}}</div>
code: <pre>{{someCode}}</pre> code: <pre>{{someCode}}</pre>
` `
}) })
class TestCodeComponent { class TestCodeComponent {

View File

@ -21,16 +21,21 @@ export interface TabInfo {
@Component({ @Component({
selector: 'code-tabs', selector: 'code-tabs',
template: ` template: `
<md-tab-group class="code-tab-group"> <md-tab-group class="code-tab-group">
<md-tab style="overflow-y: hidden;" *ngFor="let tab of tabs"> <md-tab style="overflow-y: hidden;" *ngFor="let tab of tabs">
<ng-template md-tab-label> <ng-template md-tab-label>
<span class="{{tab.class}}">{{ tab.title }}</span> <span class="{{ tab.class }}">{{ tab.title }}</span>
</ng-template> </ng-template>
<aio-code [code]="tab.code" [language]="tab.language" [linenums]="tab.linenums" <aio-code class="{{ tab.class }}"
[path]="tab.path" [region]="tab.region" [title]="tab.title" [code]="tab.code"
class="{{ tab.class }}"></aio-code> [language]="tab.language"
</md-tab> [linenums]="tab.linenums"
</md-tab-group> [path]="tab.path"
[region]="tab.region"
[title]="tab.title">
</aio-code>
</md-tab>
</md-tab-group>
` `
}) })
export class CodeTabsComponent implements OnInit { export class CodeTabsComponent implements OnInit {
@ -52,7 +57,7 @@ export class CodeTabsComponent implements OnInit {
processContent(content: string) { processContent(content: string) {
// We add it to an element so that we can easily parse the HTML // We add it to an element so that we can easily parse the HTML
const element = document.createElement('div'); const element = document.createElement('div');
// **Security:** `codeTabsContent` is provided by docs authors and as such its considered to // **Security:** `codeTabsContent` is provided by docs authors and as such is considered to
// be safe for innerHTML purposes. // be safe for innerHTML purposes.
element.innerHTML = content; element.innerHTML = content;

View File

@ -1,8 +1,7 @@
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { Component, DebugElement } from '@angular/core'; import { Component, DebugElement } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MdSnackBarModule, MdSnackBar } from '@angular/material'; import { MdSnackBarModule, MdSnackBar } from '@angular/material';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { CodeComponent } from './code.component'; import { CodeComponent } from './code.component';
@ -268,9 +267,9 @@ describe('CodeComponent', () => {
@Component({ @Component({
selector: 'aio-host-comp', selector: 'aio-host-comp',
template: ` template: `
<aio-code md-no-ink [code]="code" [language]="language" <aio-code md-no-ink [code]="code" [language]="language"
[linenums]="linenums" [path]="path" [region]="region" [linenums]="linenums" [path]="path" [region]="region"
[hideCopy]="hideCopy" [title]="title"></aio-code> [hideCopy]="hideCopy" [title]="title"></aio-code>
` `
}) })
class HostComponent { class HostComponent {