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:
committed by
Matias Niemelä
parent
8760bf7be4
commit
673d8ae583
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user