2021-12-10 02:37:01 +00:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Google LLC All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
2024-09-20 15:23:15 +00:00
|
|
|
* found in the LICENSE file at https://angular.dev/license
|
2021-12-10 02:37:01 +00:00
|
|
|
*/
|
|
|
|
|
|
2020-05-01 22:08:00 +00:00
|
|
|
const versionElement = document.querySelector('[ng-version]');
|
2020-05-08 22:12:17 +00:00
|
|
|
const versionRe = /(\d+\.\d+\.\d+(-(next|rc)\.\d+)?)/;
|
2020-05-01 22:08:00 +00:00
|
|
|
|
|
|
|
|
const defaultVersion = '0.0.0';
|
|
|
|
|
let version = defaultVersion;
|
|
|
|
|
if (versionElement) {
|
|
|
|
|
version = versionElement.getAttribute('ng-version') ?? defaultVersion;
|
|
|
|
|
version = (version.match(versionRe) ?? [''])[0] ?? defaultVersion;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const VERSION = version;
|