diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-27 09:23:03 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-27 09:23:03 +0100 |
commit | be37aed9f5d923fe16e264c6ffc97db08503b791 (patch) | |
tree | 9ab5442c37240da881c2308290f2f5425003ba92 /js/vendor/angular/angular.js | |
parent | 1bc1507dd4d92c841e9a56c7d4c241dd7fa1c25f (diff) |
more clientside updates (angular 1.4 beta, es6-shim, momentjs
Diffstat (limited to 'js/vendor/angular/angular.js')
-rw-r--r-- | js/vendor/angular/angular.js | 1909 |
1 files changed, 1022 insertions, 887 deletions
diff --git a/js/vendor/angular/angular.js b/js/vendor/angular/angular.js index 01a5386e2..67d9d67e5 100644 --- a/js/vendor/angular/angular.js +++ b/js/vendor/angular/angular.js @@ -1,6 +1,6 @@ /** - * @license AngularJS v1.3.11 - * (c) 2010-2014 Google, Inc. http://angularjs.org + * @license AngularJS v1.4.0-build.3807+sha.b3a9bd3 + * (c) 2010-2015 Google, Inc. http://angularjs.org * License: MIT */ (function(window, document, undefined) {'use strict'; @@ -38,28 +38,33 @@ function minErr(module, ErrorConstructor) { ErrorConstructor = ErrorConstructor || Error; return function() { - var code = arguments[0], - prefix = '[' + (module ? module + ':' : '') + code + '] ', - template = arguments[1], - templateArgs = arguments, + var SKIP_INDEXES = 2; - message, i; + var templateArgs = arguments, + code = templateArgs[0], + message = '[' + (module ? module + ':' : '') + code + '] ', + template = templateArgs[1], + paramPrefix, i; - message = prefix + template.replace(/\{\d+\}/g, function(match) { - var index = +match.slice(1, -1), arg; + message += template.replace(/\{\d+\}/g, function(match) { + var index = +match.slice(1, -1), + shiftedIndex = index + SKIP_INDEXES; - if (index + 2 < templateArgs.length) { - return toDebugString(templateArgs[index + 2]); + if (shiftedIndex < templateArgs.length) { + return toDebugString(templateArgs[shiftedIndex]); } + return match; }); - message = message + '\nhttp://errors.angularjs.org/1.3.11/' + + message += '\nhttp://errors.angularjs.org/1.4.0-build.3807+sha.b3a9bd3/' + (module ? module + '/' : '') + code; - for (i = 2; i < arguments.length; i++) { - message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' + - encodeURIComponent(toDebugString(arguments[i])); + + for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') { + message += paramPrefix + 'p' + (i - SKIP_INDEXES) + '=' + + encodeURIComponent(toDebugString(templateArgs[i])); } + return new ErrorConstructor(message); }; } @@ -86,13 +91,12 @@ function minErr(module, ErrorConstructor) { nodeName_: true, isArrayLike: true, forEach: true, - sortedKeys: true, forEachSorted: true, reverseParams: true, nextUid: true, setHashKey: true, extend: true, - int: true, + toInt: true, inherit: true, noop: true, identity: true, @@ -327,7 +331,7 @@ function forEach(obj, iterator, context) { obj.forEach(iterator, context, obj); } else { for (key in obj) { - if (obj.hasOwnProperty(key)) { + if (hasOwnProperty.call(obj, key)) { iterator.call(context, obj[key], key, obj); } } @@ -336,12 +340,8 @@ function forEach(obj, iterator, context) { return obj; } -function sortedKeys(obj) { - return Object.keys(obj).sort(); -} - function forEachSorted(obj, iterator, context) { - var keys = sortedKeys(obj); + var keys = Object.keys(obj).sort(); for (var i = 0; i < keys.length; i++) { iterator.call(context, obj[keys[i]], keys[i]); } @@ -421,7 +421,7 @@ function extend(dst) { return dst; } -function int(str) { +function toInt(str) { return parseInt(str, 10); } @@ -2118,11 +2118,11 @@ function toDebugString(obj) { * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". */ var version = { - full: '1.3.11', // all of these placeholder strings will be replaced by grunt's + full: '1.4.0-build.3807+sha.b3a9bd3', // all of these placeholder strings will be replaced by grunt's major: 1, // package task - minor: 3, - dot: 11, - codeName: 'spiffy-manatee' + minor: 4, + dot: 0, + codeName: 'snapshot' }; @@ -5474,13 +5474,13 @@ function $CacheFactoryProvider() { * @returns {*} the value stored. */ put: function(key, value) { + if (isUndefined(value)) return; if (capacity < Number.MAX_VALUE) { var lruEntry = lruHash[key] || (lruHash[key] = {key: key}); refresh(lruEntry); } - if (isUndefined(value)) return; if (!(key in data)) size++; data[key] = value; @@ -6192,7 +6192,7 @@ function $TemplateCacheProvider() { * * <div class="alert alert-info"> * **Best Practice**: if you intend to add and remove transcluded content manually in your directive - * (by calling the transclude function to get the DOM and and calling `element.remove()` to remove it), + * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it), * then you are also responsible for calling `$destroy` on the transclusion scope. * </div> * @@ -8897,7 +8897,7 @@ function $HttpProvider() { * To add or overwrite these defaults, simply add or remove a property from these configuration * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object * with the lowercased HTTP method name as the key, e.g. - * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }. + * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`. * * The defaults can also be set at runtime via the `$http.defaults` object in the same * fashion. For example: @@ -9165,7 +9165,7 @@ function $HttpProvider() { * - **data** – `{string|Object}` – Data to be sent as the request message data. * - **headers** – `{Object}` – Map of strings or functions which return strings representing * HTTP headers to send to the server. If the return value of a function is null, the - * header will not be sent. + * header will not be sent. Functions accept a config object as an argument. * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token. * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token. * - **transformRequest** – @@ -9384,12 +9384,12 @@ function $HttpProvider() { : $q.reject(resp); } - function executeHeaderFns(headers) { + function executeHeaderFns(headers, config) { var headerContent, processedHeaders = {}; forEach(headers, function(headerFn, header) { if (isFunction(headerFn)) { - headerContent = headerFn(); + headerContent = headerFn(config); if (headerContent != null) { processedHeaders[header] = headerContent; } @@ -9423,7 +9423,7 @@ function $HttpProvider() { } // execute if header value is a function for merged headers - return executeHeaderFns(reqHeaders); + return executeHeaderFns(reqHeaders, shallowCopy(config)); } } @@ -10510,7 +10510,7 @@ function parseAbsoluteUrl(absoluteUrl, locationObj) { locationObj.$$protocol = parsedUrl.protocol; locationObj.$$host = parsedUrl.hostname; - locationObj.$$port = int(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; + locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; } @@ -11320,7 +11320,7 @@ function $LocationProvider() { // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) // currently we open nice url link and redirect then - if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return; + if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.which == 2 || event.button == 2) return; var elm = jqLite(event.target); @@ -12272,7 +12272,7 @@ Parser.prototype = { }, { assign: function(scope, value, locals) { var o = object(scope, locals); - if (!o) object.assign(scope, o = {}, locals); + if (!o) object.assign(scope, o = {}); return getter.assign(o, value); } }); @@ -12298,7 +12298,7 @@ Parser.prototype = { var key = ensureSafeMemberName(indexFn(self, locals), expression); // prevent overwriting of Function.constructor which would break ensureSafeObject check var o = ensureSafeObject(obj(self, locals), expression); - if (!o) obj.assign(self, o = {}, locals); + if (!o) obj.assign(self, o = {}); return o[key] = value; } }); @@ -12408,19 +12408,18 @@ Parser.prototype = { // Parser helper functions ////////////////////////////////////////////////// -function setter(obj, locals, path, setValue, fullExp) { +function setter(obj, path, setValue, fullExp) { ensureSafeObject(obj, fullExp); - ensureSafeObject(locals, fullExp); var element = path.split('.'), key; for (var i = 0; element.length > 1; i++) { key = ensureSafeMemberName(element.shift(), fullExp); - var propertyObj = (i === 0 && locals && locals[key]) || obj[key]; + var propertyObj = ensureSafeObject(obj[key], fullExp); if (!propertyObj) { propertyObj = {}; obj[key] = propertyObj; } - obj = ensureSafeObject(propertyObj, fullExp); + obj = propertyObj; } key = ensureSafeMemberName(element.shift(), fullExp); ensureSafeObject(obj[key], fullExp); @@ -12547,8 +12546,8 @@ function getterFn(path, options, fullExp) { } fn.sharedGetter = true; - fn.assign = function(self, value, locals) { - return setter(self, locals, path, value, path); + fn.assign = function(self, value) { + return setter(self, path, value, path); }; getterFnCache[path] = fn; return fn; @@ -15923,7 +15922,7 @@ function $SnifferProvider() { this.$get = ['$window', '$document', function($window, $document) { var eventSupport = {}, android = - int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), + toInt((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), boxee = /Boxee/i.test(($window.navigator || {}).userAgent), document = $document[0] || {}, vendorPrefix, @@ -15950,8 +15949,8 @@ function $SnifferProvider() { animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle)); if (android && (!transitions || !animations)) { - transitions = isString(document.body.style.webkitTransition); - animations = isString(document.body.style.webkitAnimation); + transitions = isString(bodyStyle.webkitTransition); + animations = isString(bodyStyle.webkitAnimation); } } @@ -16007,7 +16006,7 @@ var $compileMinErr = minErr('$compile'); * @param {string} tpl The HTTP request template URL * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty * - * @return {Promise} the HTTP Promise for the given. + * @return {Promise} a promise for the HTTP response data of the given URL. * * @property {number} totalPendingRequests total amount of pending template requests being downloaded. */ @@ -16036,12 +16035,14 @@ function $TemplateRequestProvider() { handleRequestFn.totalPendingRequests--; }) .then(function(response) { + $templateCache.put(tpl, response.data); return response.data; }, handleError); function handleError(resp) { if (!ignoreRequestError) { - throw $compileMinErr('tpload', 'Failed to load template: {0}', tpl); + throw $compileMinErr('tpload', 'Failed to load template: {0} (HTTP status: {1} {2})', + tpl, resp.status, resp.statusText); } return $q.reject(resp); } @@ -16171,6 +16172,7 @@ function $$TestabilityProvider() { function $TimeoutProvider() { this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler', function($rootScope, $browser, $q, $$q, $exceptionHandler) { + var deferreds = {}; @@ -16183,15 +16185,18 @@ function $TimeoutProvider() { * block and delegates any exceptions to * {@link ng.$exceptionHandler $exceptionHandler} service. * - * The return value of registering a timeout function is a promise, which will be resolved when - * the timeout is reached and the timeout function is executed. + * The return value of calling `$timeout` is a promise, which will be resolved when + * the delay has passed and the timeout function, if provided, is executed. * * To cancel a timeout request, call `$timeout.cancel(promise)`. * * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to * synchronously flush the queue of deferred functions. * - * @param {function()} fn A function, whose execution should be delayed. + * If you only want a promise that will be resolved after some specified delay + * then you can call `$timeout` without the `fn` function. + * + * @param {function()=} fn A function, whose execution should be delayed. * @param {number=} [delay=0] Delay in milliseconds. * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. @@ -16200,6 +16205,12 @@ function $TimeoutProvider() { * */ function timeout(fn, delay, invokeApply) { + if (!isFunction(fn)) { + invokeApply = delay; + delay = fn; + fn = noop; + } + var skipApply = (isDefined(invokeApply) && !invokeApply), deferred = (skipApply ? $$q : $q).defer(), promise = deferred.promise, @@ -16858,6 +16869,8 @@ function currencyFilter($locale) { * * If the input is not a number an empty string is returned. * + * If the input is an infinite (Infinity/-Infinity) the Infinity symbol '∞' is returned. + * * @param {number|string} number Number to format. * @param {(number|string)=} fractionSize Number of decimal places to round the number to. * If this is not provided then the fraction size is computed from the current locale's number @@ -16914,16 +16927,22 @@ function numberFilter($locale) { var DECIMAL_SEP = '.'; function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { - if (!isFinite(number) || isObject(number)) return ''; + if (isObject(number)) return ''; var isNegative = number < 0; number = Math.abs(number); + + var isInfinity = number === Infinity; + if (!isInfinity && !isFinite(number)) return ''; + var numStr = number + '', formatedText = '', + hasExponent = false, parts = []; - var hasExponent = false; - if (numStr.indexOf('e') !== -1) { + if (isInfinity) formatedText = '\u221e'; + + if (!isInfinity && numStr.indexOf('e') !== -1) { var match = numStr.match(/([\d\.]+)e(-?)(\d+)/); if (match && match[2] == '-' && match[3] > fractionSize + 1) { number = 0; @@ -16933,7 +16952,7 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { } } - if (!hasExponent) { + if (!isInfinity && !hasExponent) { var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length; // determine fractionSize if it is not specified @@ -17205,13 +17224,13 @@ function dateFilter($locale) { timeSetter = match[8] ? date.setUTCHours : date.setHours; if (match[9]) { - tzHour = int(match[9] + match[10]); - tzMin = int(match[9] + match[11]); + tzHour = toInt(match[9] + match[10]); + tzMin = toInt(match[9] + match[11]); } - dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3])); - var h = int(match[4] || 0) - tzHour; - var m = int(match[5] || 0) - tzMin; - var s = int(match[6] || 0); + dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3])); + var h = toInt(match[4] || 0) - tzHour; + var m = toInt(match[5] || 0) - tzMin; + var s = toInt(match[6] || 0); var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000); timeSetter.call(date, h, m, s, ms); return date; @@ -17228,14 +17247,14 @@ function dateFilter($locale) { format = format || 'mediumDate'; format = $locale.DATETIME_FORMATS[format] || format; if (isString(date)) { - date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date); + date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date); } if (isNumber(date)) { date = new Date(date); } - if (!isDate(date)) { + if (!isDate(date) || !isFinite(date.getTime())) { return date; } @@ -17342,7 +17361,8 @@ var uppercaseFilter = valueFn(uppercase); * @param {string|number} limit The length of the returned array or string. If the `limit` number * is positive, `limit` number of items from the beginning of the source array/string are copied. * If the number is negative, `limit` number of items from the end of the source array/string - * are copied. The `limit` will be trimmed if it exceeds `array.length` + * are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined, + * the input will be returned unchanged. * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array * had less than `limit` elements. * @@ -17415,21 +17435,17 @@ var uppercaseFilter = valueFn(uppercase); */ function limitToFilter() { return function(input, limit) { - if (isNumber(input)) input = input.toString(); - if (!isArray(input) && !isString(input)) return input; - if (Math.abs(Number(limit)) === Infinity) { limit = Number(limit); } else { - limit = int(limit); + limit = toInt(limit); } + if (isNaN(limit)) return input; - //NaN check on limit - if (limit) { - return limit > 0 ? input.slice(0, limit) : input.slice(limit); - } else { - return isString(input) ? "" : []; - } + if (isNumber(input)) input = input.toString(); + if (!isArray(input) && !isString(input)) return input; + + return limit >= 0 ? input.slice(0, limit) : input.slice(limit); }; } @@ -17665,9 +17681,6 @@ var htmlAnchorDirective = valueFn({ compile: function(element, attr) { if (!attr.href && !attr.xlinkHref && !attr.name) { return function(scope, element) { - // If the linked element is not an anchor tag anymore, do nothing - if (element[0].nodeName.toLowerCase() !== 'a') return; - // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? 'xlink:href' : 'href'; @@ -18023,22 +18036,34 @@ var htmlAnchorDirective = valueFn({ var ngAttributeAliasDirectives = {}; - // boolean attrs are evaluated forEach(BOOLEAN_ATTR, function(propName, attrName) { // binding to multiple is not supported if (propName == "multiple") return; + function defaultLinkFn(scope, element, attr) { + scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { + attr.$set(attrName, !!value); + }); + } + var normalized = directiveNormalize('ng-' + attrName); + var linkFn = defaultLinkFn; + + if (propName === 'checked') { + linkFn = function(scope, element, attr) { + // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input + if (attr.ngModel !== attr[normalized]) { + defaultLinkFn(scope, element, attr); + } + }; + } + ngAttributeAliasDirectives[normalized] = function() { return { restrict: 'A', priority: 100, - link: function(scope, element, attr) { - scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { - attr.$set(attrName, !!value); - }); - } + link: linkFn }; }; }); @@ -18172,8 +18197,8 @@ function FormController(element, attrs, $scope, $animate, $interpolate) { var parentForm = form.$$parentForm = element.parent().controller('form') || nullFormCtrl; // init state - form.$error = {}; - form.$$success = {}; + form.$error = createMap(); + form.$$success = createMap(); form.$pending = undefined; form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope); form.$dirty = false; @@ -18597,19 +18622,19 @@ var formDirectiveFactory = function(isNgForm) { alias = controller.$name; if (alias) { - setter(scope, null, alias, controller, alias); + setter(scope, alias, controller, alias); attr.$observe(attr.name ? 'name' : 'ngForm', function(newValue) { if (alias === newValue) return; - setter(scope, null, alias, undefined, alias); + setter(scope, alias, undefined, alias); alias = newValue; - setter(scope, null, alias, controller, alias); + setter(scope, alias, controller, alias); parentFormCtrl.$$renameControl(controller, alias); }); } formElement.on('$destroy', function() { parentFormCtrl.$removeControl(controller); if (alias) { - setter(scope, null, alias, undefined, alias); + setter(scope, alias, undefined, alias); } extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards }); @@ -18686,21 +18711,19 @@ var inputType = { <script> angular.module('textInputExample', []) .controller('ExampleController', ['$scope', function($scope) { - $scope.example = { - text: 'guest', - word: /^\s*\w*\s*$/ - }; + $scope.text = 'guest'; + $scope.word = /^\s*\w*\s*$/; }]); </script> <form name="myForm" ng-controller="ExampleController"> - Single word: <input type="text" name="input" ng-model="example.text" - ng-pattern="example.word" required ng-trim="false"> + Single word: <input type="text" name="input" ng-model="text" + ng-pattern="word" required ng-trim="false"> <span class="error" ng-show="myForm.input.$error.required"> Required!</span> <span class="error" ng-show="myForm.input.$error.pattern"> Single word only!</span> - <tt>text = {{example.text}}</tt><br/> + <tt>text = {{text}}</tt><br/> <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> @@ -18708,9 +18731,9 @@ var inputType = { </form> </file> <file name="protractor.js" type="protractor"> - var text = element(by.binding('example.text')); + var text = element(by.binding('text')); var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.text')); + var input = element(by.model('text')); it('should initialize to model', function() { expect(text.getText()).toContain('guest'); @@ -18772,20 +18795,18 @@ var inputType = { <script> angular.module('dateInputExample', []) .controller('DateController', ['$scope', function($scope) { - $scope.example = { - value: new Date(2013, 9, 22) - }; + $scope.value = new Date(2013, 9, 22); }]); </script> <form name="myForm" ng-controller="DateController as dateCtrl"> Pick a date in 2013: - <input type="date" id="exampleInput" name="input" ng-model="example.value" + <input type="date" id="exampleInput" name="input" ng-model="value" placeholder="yyyy-MM-dd" min="2013-01-01" max="2013-12-31" required /> <span class="error" ng-show="myForm.input.$error.required"> Required!</span> <span class="error" ng-show="myForm.input.$error.date"> Not a valid date!</span> - <tt>value = {{example.value | date: "yyyy-MM-dd"}}</tt><br/> + <tt>value = {{value | date: "yyyy-MM-dd"}}</tt><br/> <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> @@ -18793,9 +18814,9 @@ var inputType = { </form> </file> <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value | date: "yyyy-MM-dd"')); + var value = element(by.binding('value | date: "yyyy-MM-dd"')); var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); + var input = element(by.model('value')); // currently protractor/webdriver does not support // sending keys to all known HTML5 input controls @@ -18865,20 +18886,18 @@ var inputType = { <script> angular.module('dateExample', []) .controller('DateController', ['$scope', function($scope) { - $scope.example = { - value: new Date(2010, 11, 28, 14, 57) - }; + $scope.value = new Date(2010, 11, 28, 14, 57); }]); </script> <form name="myForm" ng-controller="DateController as dateCtrl"> Pick a date between in 2013: - <input type="datetime-local" id="exampleInput" name="input" ng-model="example.value" + <input type="datetime-local" id="exampleInput" name="input" ng-model="value" placeholder="yyyy-MM-ddTHH:mm:ss" min="2001-01-01T00:00:00" max="2013-12-31T00:00:00" required /> <span class="error" ng-show="myForm.input.$error.required"> Required!</span> <span class="error" ng-show="myForm.input.$error.datetimelocal"> Not a valid date!</span> - <tt>value = {{example.value | date: "yyyy-MM-ddTHH:mm:ss"}}</tt><br/> + <tt>value = {{value | date: "yyyy-MM-ddTHH:mm:ss"}}</tt><br/> <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> @@ -18886,9 +18905,9 @@ var inputType = { </form> </file> <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value | date: "yyyy-MM-ddTHH:mm:ss"')); + var value = element(by.binding('value | date: "yyyy-MM-ddTHH:mm:ss"')); var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); + var input = element(by.model('value')); // currently protractor/webdriver does not support // sending keys to all known HTML5 input controls @@ -18959,20 +18978,18 @@ var inputType = { <script> angular.module('timeExample', []) .controller('DateController', ['$scope', function($scope) { - $scope.example = { - value: new Date(1970, 0, 1, 14, 57, 0) - }; + $scope.value = new Date(1970, 0, 1, 14, 57, 0); }]); </script> <form name="myForm" ng-controller="DateController as dateCtrl"> Pick a between 8am and 5pm: - <input type="time" id="exampleInput" name="input" ng-model="example.value" + <input type="time" id="exampleInput" name="input" ng-model="value" placeholder="HH:mm:ss" min="08:00:00" max="17:00:00" required /> <span class="error" ng-show="myForm.input.$error.required"> Required!</span> <span class="error" ng-show="myForm.input.$error.time"> Not a valid date!</span> - <tt>value = {{example.value | date: "HH:mm:ss"}}</tt><br/> + <tt>value = {{value | date: "HH:mm:ss"}}</tt><br/> <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> @@ -18980,9 +18997,9 @@ var inputType = { </form> </file> <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value | date: "HH:mm:ss"')); + var value = element(by.binding('value | date: "HH:mm:ss"')); var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); + var input = element(by.model('value')); // currently protractor/webdriver does not support // sending keys to all known HTML5 input controls @@ -19052,20 +19069,18 @@ var inputType = { <script> angular.module('weekExample', []) .controller('DateController', ['$scope', function($scope) { - $scope.example = { - value: new Date(2013, 0, 3) - }; + $scope.value = new Date(2013, 0, 3); }]); </script> <form name="myForm" ng-controller="DateController as dateCtrl"> Pick a date between in 2013: - <input id="exampleInput" type="week" name="input" ng-model="example.value" + <input id="exampleInput" type="week" name="input" ng-model="value" placeholder="YYYY-W##" min="2012-W32" max="2013-W52" required /> <span class="error" ng-show="myForm.input.$error.required"> Required!</span> <span class="error" ng-show="myForm.input.$error.week"> Not a valid date!</span> - <tt>value = {{example.value | date: "yyyy-Www"}}</tt><br/> + <tt>value = {{value | date: "yyyy-Www"}}</tt><br/> <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> @@ -19073,9 +19088,9 @@ var inputType = { </form> </file> <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value | date: "yyyy-Www"')); + var value = element(by.binding('value | date: "yyyy-Www"')); var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); + var input = element(by.model('value')); // currently protractor/webdriver does not support // sending keys to all known HTML5 input controls @@ -19145,20 +19160,18 @@ var inputType = { <script> angular.module('monthExample', []) .controller('DateController', ['$scope', function($scope) { - $scope.example = { - value: new Date(2013, 9, 1) - }; + $scope.value = new Date(2013, 9, 1); }]); </script> <form name="myForm" ng-controller="DateController as dateCtrl"> Pick a month in 2013: - <input id="exampleInput" type="month" name="input" ng-model="example.value" + <input id="exampleInput" type="month" name="input" ng-model="value" placeholder="yyyy-MM" min="2013-01" max="2013-12" required /> <span class="error" ng-show="myForm.input.$error.required"> Required!</span> <span class="error" ng-show="myForm.input.$error.month"> Not a valid month!</span> - <tt>value = {{example.value | date: "yyyy-MM"}}</tt><br/> + <tt>value = {{value | date: "yyyy-MM"}}</tt><br/> <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> @@ -19166,9 +19179,9 @@ var inputType = { </form> </file> <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value | date: "yyyy-MM"')); + var value = element(by.binding('value | date: "yyyy-MM"')); var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); + var input = element(by.model('value')); // currently protractor/webdriver does not support // sending keys to all known HTML5 input controls @@ -19244,19 +19257,17 @@ var inputType = { <script> angular.module('numberExample', []) .controller('ExampleController', ['$scope', function($scope) { - $scope.example = { - value: 12 - }; + $scope.value = 12; }]); </script> <form name="myForm" ng-controller="ExampleController"> - Number: <input type="numbe |