fix: display framework version on bootstrapped component (#13252)

This commit is contained in:
Miško Hevery
2016-12-06 16:21:07 -08:00
committed by Alex Rickabaugh
parent 986abbe0b2
commit 16efb13dd1
43 changed files with 294 additions and 103 deletions
+1 -1
View File
@@ -35,4 +35,4 @@ export * from './core_private_export';
export * from './animation/metadata';
export {AnimationTransitionEvent} from './animation/animation_transition_event';
export {AnimationPlayer} from './animation/animation_player';
export {Sanitizer, SecurityContext} from './security';
export {Sanitizer, SecurityContext} from './security';
@@ -13,6 +13,7 @@ import {isPresent, looseIdentical} from '../facade/lang';
import {ViewEncapsulation} from '../metadata/view';
import {RenderComponentType, RenderDebugInfo, Renderer, RootRenderer} from '../render/api';
import {Sanitizer} from '../security';
import {VERSION} from '../version';
import {ExpressionChangedAfterItHasBeenCheckedError} from './errors';
import {AppView} from './view';
@@ -360,6 +361,7 @@ export function selectOrCreateRenderHostElement(
for (let i = 0; i < attrs.length; i += 2) {
renderer.setElementAttribute(hostElement, attrs.get(i), attrs.get(i + 1));
}
renderer.setElementAttribute(hostElement, 'ng-version', VERSION.full);
} else {
hostElement = createRenderElement(renderer, null, elementName, attrs, debugInfo);
}
+6 -1
View File
@@ -19,4 +19,9 @@ export class Version {
get minor(): string { return this.full.split('.')[1]; }
get patch(): string { return this.full.split('.').slice(2).join('.'); }
}
}
/**
* @stable
*/
export const VERSION = new Version('0.0.0-PLACEHOLDER');