feat(aio): add attribute utils for code atty interpretation.

These utils support flexible, natural attribute interpretation as applied to code-example and code-pane. Then apply those utils to code-example and live-example
This commit is contained in:
Ward Bell
2017-05-02 19:17:05 -07:00
committed by Matias Niemelä
parent 8760bf7be4
commit 673d8ae583
4 changed files with 208 additions and 26 deletions
@@ -1,5 +1,6 @@
/* tslint:disable component-selector */
import { Component, ElementRef, OnInit } from '@angular/core';
import { getBoolFromAttribute } from 'app/shared/attribute-utils';
/**
* An embeddable code block that displays nicely formatted code.
@@ -38,7 +39,7 @@ export class CodeExampleComponent implements OnInit {
this.path = element.getAttribute('path') || '';
this.region = element.getAttribute('region') || '';
this.title = element.getAttribute('title') || '';
this.hideCopy = element.getAttribute('hideCopy') === 'true';
this.hideCopy = getBoolFromAttribute(element, ['hidecopy', 'hide-copy']);
}
ngOnInit() {