From 0782422d1f319593ffe3f0d7b2372ba995ad362c Mon Sep 17 00:00:00 2001 From: Di Peng Date: Mon, 11 Jul 2011 17:31:29 -0700 Subject: feat(angular.version): add angular.version - placeholders are replaced with actual angular versions when doing rake compile --- src/Angular.js | 22 ++++++++++++++++++++++ src/AngularPublic.js | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Angular.js b/src/Angular.js index 7d31330e..28ece3d1 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -1004,3 +1004,25 @@ function assertArg(arg, name, reason) { function assertArgFn(arg, name) { assertArg(isFunction(arg, name, 'not a function')); } + + +/** + * @ngdoc property + * @name angular.version + * @description + * Object which contains information about the current AngularJS version. The object has following + * properties: + * + * - `full` – `{string}` – full version string, e.g. "0.9.18" + * - `major` – `{number}` – major version number, e.g. 0 + * - `minor` – `{number}` – minor version number, e.g. 9 + * - `dot` – `{number}` – dot version number, e.g. 18 + * - `codeName` – `{string}` – code name of the release, e.g. "jiggling-armfat" + */ +var version = { + full: '"NG_VERSION_FULL"', // all of these placeholder strings will be replaced by rake's + major: "NG_VERSION_MAJOR", // compile task + minor: "NG_VERSION_MINOR", + dot: "NG_VERSION_DOT", + codeName: '"NG_VERSION_CODENAME"' +} diff --git a/src/AngularPublic.js b/src/AngularPublic.js index ebd54621..bd86a9be 100644 --- a/src/AngularPublic.js +++ b/src/AngularPublic.js @@ -19,6 +19,7 @@ angularService('$browser', function($log){ return browserSingleton; }, {$inject:['$log']}); + extend(angular, { // disabled for now until we agree on public name //'annotate': annotate, @@ -41,7 +42,8 @@ extend(angular, { 'isFunction': isFunction, 'isObject': isObject, 'isNumber': isNumber, - 'isArray': isArray + 'isArray': isArray, + 'version': version }); //try to bind to jquery now so that one can write angular.element().read() -- cgit v1.2.3