From 848f0119aba974092b1e994188f45ed745ebd571 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 5 Sep 2013 09:38:15 -0400 Subject: [PATCH 01/19] Corrected error where MainCtrl should be ScrollCtrl --- src/ng/anchorScroll.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/anchorScroll.js b/src/ng/anchorScroll.js index a87995cf2036..cd3885bf628c 100644 --- a/src/ng/anchorScroll.js +++ b/src/ng/anchorScroll.js @@ -16,7 +16,7 @@ * @example -
+
Go to bottom You're at the bottom!
From 280ab2acf2b851d83aeff5b23fff208ec964331e Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 5 Sep 2013 09:40:05 -0400 Subject: [PATCH 02/19] Added styling to prevent the scrollable area from looking huge. --- src/ng/anchorScroll.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ng/anchorScroll.js b/src/ng/anchorScroll.js index cd3885bf628c..48779e1585f6 100644 --- a/src/ng/anchorScroll.js +++ b/src/ng/anchorScroll.js @@ -16,7 +16,7 @@ * @example -
+
Go to bottom You're at the bottom!
@@ -34,6 +34,10 @@ } + .scroll-area { + height: 450px; + overflow: auto; + } #bottom { display: block; margin-top: 2000px; From 3159c4a13b29b407f5bd963f7fb1747d6a3a256b Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 5 Sep 2013 09:46:14 -0400 Subject: [PATCH 03/19] Tweaked height a little on scroll area. --- src/ng/anchorScroll.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/anchorScroll.js b/src/ng/anchorScroll.js index 48779e1585f6..1e3c707fa2ad 100644 --- a/src/ng/anchorScroll.js +++ b/src/ng/anchorScroll.js @@ -35,7 +35,7 @@ .scroll-area { - height: 450px; + height: 350px; overflow: auto; } #bottom { From ccd7c36cfe868c5e7de7296511557bd1307c00dd Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 5 Sep 2013 09:38:15 -0400 Subject: [PATCH 04/19] docs($anchorScroll) change MainCtrl to ScrollCtrl docs($anchorScroll) add scroll area CSS styling docs($anchorScroll) change scroll area height to 350px --- src/ng/anchorScroll.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ng/anchorScroll.js b/src/ng/anchorScroll.js index a87995cf2036..1e3c707fa2ad 100644 --- a/src/ng/anchorScroll.js +++ b/src/ng/anchorScroll.js @@ -16,7 +16,7 @@ * @example -
+
Go to bottom You're at the bottom!
@@ -34,6 +34,10 @@ } + .scroll-area { + height: 350px; + overflow: auto; + } #bottom { display: block; margin-top: 2000px; From 552d4663533444909be96c03e06604424df6bb91 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 5 Sep 2013 09:38:15 -0400 Subject: [PATCH 05/19] docs($anchorScroll) change MainCtrl to ScrollCtrl and add styling Fix an issue where the example was not working due to referencing the wrong controller in the html ng-controller attribute. The demo was also unsightly due to it being too long to look reasonable on the screen. Add overflow and height CSS styling to the containing element to clean it up. --- src/ng/anchorScroll.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ng/anchorScroll.js b/src/ng/anchorScroll.js index a87995cf2036..1e3c707fa2ad 100644 --- a/src/ng/anchorScroll.js +++ b/src/ng/anchorScroll.js @@ -16,7 +16,7 @@ * @example -
+
Go to bottom You're at the bottom!
@@ -34,6 +34,10 @@ } + .scroll-area { + height: 350px; + overflow: auto; + } #bottom { display: block; margin-top: 2000px; From edde729ad0bba74fc67aa91d128d887930ebc721 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 5 Sep 2013 01:06:30 +0200 Subject: [PATCH 06/19] chore(release): start 1.2.0-rc.3 ferocious-twitch iteration --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1840abe2770b..8cc184cb194a 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "angularjs", - "version": "1.2.0-rc.2", - "cdnVersion": "1.2.0rc1", - "codename": "barehand-atomsplitting", + "version": "1.2.0-snapshot", + "cdnVersion": "1.2.0-rc.2", + "codename": "ferocious-twitch", "repository": { "type": "git", "url": "https://github.com/angular/angular.js.git" From 8de89f4ecd77f1035b7382d73fe1b8e8aee88cc4 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Fri, 9 Aug 2013 17:26:07 -0700 Subject: [PATCH 07/19] chore(release): add script for comparing master and stable branches --- compare-master-to-stable.js | 163 ++++++++++++++++++++++++++++++++++++ package.json | 4 +- 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100755 compare-master-to-stable.js diff --git a/compare-master-to-stable.js b/compare-master-to-stable.js new file mode 100755 index 000000000000..404383b01d9c --- /dev/null +++ b/compare-master-to-stable.js @@ -0,0 +1,163 @@ +#!/usr/local/bin/node + +var util = require('util'); +var cp = require('child_process'); + +var Q = require('q'); +var _ = require('lodash'); +var semver = require('semver'); + +var exec = function (cmd) { + return function () { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift(cmd); + var fullCmd = util.format.apply(util, args); + return Q.nfcall(cp.exec, fullCmd).then(function (out) { + return out[0].split('\n'); + }); + }; +}; + +var andThen = function (fn, after) { + return function () { + return fn.apply(this, arguments).then(after); + }; +}; + +var oneArg = function (fn) { + return function (arg) { + return fn(arg); + }; +}; + +var oneLine = function (lines) { + return lines[0].trim(); +}; + +var noArgs = function (fn) { + return function () { + return fn(); + }; +}; + +var identity = function (i) { return i; }; + +// like Q.all, but runs the comands in series +// useful for ensuring env state (like which branch is checked out) +var allInSeries = function (fn) { + return function (args) { + var results = []; + var def; + while (args.length > 0) { + (function (arg) { + if (def) { + def = def.then(function () { + return fn(arg); + }); + } else { + def = fn(arg); + } + def = def.then(function (res) { + results.push(res); + }); + }(args.pop())); + } + return def.then(function () { + return results; + }); + }; +}; + +var compareBranches = function (left, right) { + console.log('# These commits are in ' + left.name + ' but not in ' + right.name + '\n'); + console.log(_(left.log). + difference(right.log). + map(function (line) { + return left.full[left.log.indexOf(line)]; // lol O(n^2) + }). + value(). + join('\n')); +}; + +var checkout = oneArg(exec('git checkout %s')); + +var getCurrentBranch = andThen(noArgs(exec('git rev-parse --abbrev-ref HEAD')), oneLine); +var getTags = noArgs(exec('git tag')); +var getShaOfTag = oneArg(exec('git rev-list %s | head -n 1')); +var getTheLog = oneArg(exec('git log --pretty=oneline %s..HEAD | cat')); + +// remember this so we can restore state +var currentBranch; + +getCurrentBranch(). +then(function (branch) { + currentBranch = branch; +}). +then(getTags). +then(function (tags) { + return tags. + filter(semver.valid). + map(semver.clean). + sort(semver.rcompare); +}). +then(function (tags) { + var major = tags[0].split('.')[0] + '.x'; + return tags. + filter(function (ver) { + return semver.satisfies(ver, major); + }); +}). +then(function (tags) { + return _(tags). + groupBy(function (tag) { + return tag.split('.')[1]; + }). + map(function (group) { + return _.first(group); + }). + map(function (tag) { + return 'v' + tag; + }). + value(); +}). +then(function (tags) { + return [ + { name: 'v1.0.x', tag: tags[0] }, + { name: 'master', tag: tags[1] } + ]; +}). +then(allInSeries(function (branch) { + return checkout(branch.name). + then(function () { + return getTheLog(branch.tag); + }). + then(function (log) { + return log. + filter(identity); + }). + then(function (log) { + branch.full = log.map(function (line) { + line = line.split(' '); + var sha = line.shift(); + var msg = line.join(' '); + return sha + (msg.toLowerCase().indexOf('fix') === -1 ? ' ' : ' * ') + msg; + }); + branch.log = log.map(function (line) { + return line.substr(41) + }); + return branch; + }); +})). +then(function (pairs) { + compareBranches(pairs[0], pairs[1]); + console.log('\n'); + compareBranches(pairs[1], pairs[0]); + return pairs; +}). +then(function () { + return checkout(currentBranch); +}). +catch(function (e) { + console.log(e.stack); +}); + diff --git a/package.json b/package.json index 8cc184cb194a..2cc6daf44ec2 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,9 @@ "grunt-ddescribe-iit": "~0.0.1", "grunt-merge-conflict": "~0.0.1", "promises-aplus-tests": "~1.3.2", - "grunt-shell": "~0.3.1" + "grunt-shell": "~0.3.1", + "semver": "~2.1.0", + "lodash": "~1.3.1" }, "licenses": [ { From b4169e94cf000994dcad0637a6f1f20ec0647a14 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 5 Sep 2013 01:31:34 +0200 Subject: [PATCH 08/19] docs(changelog): add a note about directives ending w/ -start and -end Closes #3589 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4119b9f3239..0df1c3a69131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -559,6 +559,12 @@ Contains only these fixes cherry-picked from [v1.2.0rc1](#1.2.0rc1). JS: scope.foo = function() { alert(1); } HTML:
+ - due to [e46100f7](https://github.com/angular/angular.js/commit/e46100f7097d9a8f174bdb9e15d4c6098395c3f2), existing directives + with name ending with `"-start"` or `"-end"` will stop working. + + This change was necessary to enable multi-element directives. The best fix is to rename existing directives, so that they + don't end with these suffixes. + - **$q:** due to [f078762d](https://github.com/angular/angular.js/commit/f078762d48d0d5d9796dcdf2cb0241198677582c), the `always` method is now exposed as `finally`. From 6a3a991124e37c96d53ca0a21b2061d83a961795 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 5 Sep 2013 08:31:58 +0100 Subject: [PATCH 09/19] docs($anchorScroll): provide an example of basic usage. Per a request made by Peter Bacon Darwin here: http://www.benlesh.com/2013/02/angular-js-scrolling-to-element-by-id.html?showComment=1370941217879#c8718313084813008967 --- src/ng/anchorScroll.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/ng/anchorScroll.js b/src/ng/anchorScroll.js index 0ddc9c78af65..a87995cf2036 100644 --- a/src/ng/anchorScroll.js +++ b/src/ng/anchorScroll.js @@ -10,8 +10,36 @@ * according to rules specified in * {@link http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document Html5 spec}. * - * It also watches the `$location.hash()` and scroll whenever it changes to match any anchor. + * It also watches the `$location.hash()` and scrolls whenever it changes to match any anchor. * This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`. + * + * @example + + +
+ Go to bottom + You're at the bottom! +
+
+ + function ScrollCtrl($scope, $location, $anchorScroll) { + $scope.gotoBottom = function (){ + // set the location.hash to the id of + // the element you wish to scroll to. + $location.hash('bottom'); + + // call $anchorScroll() + $anchorScroll(); + } + } + + + #bottom { + display: block; + margin-top: 2000px; + } + +
*/ function $AnchorScrollProvider() { From 5030052f09e44bcc31adfcde3bc04c6c229bb88c Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 5 Sep 2013 10:01:50 +0100 Subject: [PATCH 10/19] docs(): parameter for html5Mode is boolean --- src/ng/location.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/location.js b/src/ng/location.js index f7f2669fad11..94917cd1e5cb 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -503,7 +503,7 @@ function $LocationProvider(){ * @name ng.$locationProvider#html5Mode * @methodOf ng.$locationProvider * @description - * @param {string=} mode Use HTML5 strategy if available. + * @param {boolean=} mode Use HTML5 strategy if available. * @returns {*} current value if used as getter or itself (chaining) if used as setter */ this.html5Mode = function(mode) { From b9251ec1cefa1bd1339592852c094e9f601dcf6f Mon Sep 17 00:00:00 2001 From: Calvin Fernandez Date: Fri, 23 Aug 2013 18:50:08 -0700 Subject: [PATCH 11/19] docs(bootstrap.ngdoc): clarify bootstrap example Clear up confusion about module declaration when using manual bootstrap. --- docs/content/guide/bootstrap.ngdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/content/guide/bootstrap.ngdoc b/docs/content/guide/bootstrap.ngdoc index ef384168e9e4..9fbe97ca2984 100644 --- a/docs/content/guide/bootstrap.ngdoc +++ b/docs/content/guide/bootstrap.ngdoc @@ -92,7 +92,8 @@ Here is an example of manually initializing Angular: @@ -100,9 +101,8 @@ Here is an example of manually initializing Angular: Note that we have provided the name of our application module to be loaded into the injector as the second -parameter of the {@link api/angular.bootstrap} function. This example is equivalent to using the -{@link api/ng.directive:ngApp ng-app} directive, with `ng-app="optionalModuleName"`, as in the automatic -initialization example above. +parameter of the {@link api/angular.bootstrap} function. Notice that `angular.bootstrap` will not create modules +on the fly. You must create any custom {@link guide/module modules} before you pass them as a parameter. This is the sequence that your code should follow: From e1b2007de72d885f4248da4df562549fcff82fbf Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 5 Sep 2013 12:18:56 +0100 Subject: [PATCH 12/19] docs(angular.bootstrap): clarify modules parameter It was not clear what you could pass to specify modules to load in the `module` parameter of this function. The `modules` parameter takes an array. The main case is to provide a String, which is the name of a "predefined" angular module. The side cases are to provide a Function (or an annotated function in the form of an Array), which will be invoked by the injector as a run block. It is not possible to "define" new modules via this parameter. Closes #3692 --- src/Angular.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Angular.js b/src/Angular.js index 9e2f93f2eac6..0a61d5a95eb0 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -1053,7 +1053,9 @@ function angularInit(element, bootstrap) { * They must use {@link api/ng.directive:ngApp ngApp}. * * @param {Element} element DOM element which is the root of angular application. - * @param {Array=} modules an array of module declarations. See: {@link angular.module modules} + * @param {Array=} modules an array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. See: {@link angular.module modules} * @returns {AUTO.$injector} Returns the newly created injector for this app. */ function bootstrap(element, modules) { From 17a6215cbf30b5b5346d1304ff98f314108c8baa Mon Sep 17 00:00:00 2001 From: Nick Donohue Date: Thu, 5 Sep 2013 13:03:45 +0100 Subject: [PATCH 13/19] docs(css_styling_guide): add ng-scope and ng-binding classes I noticed angular was adding these css classes to elements and believe they should be listed in the documentation at this page. The ng-scope class is mentioned in the developer guide, hence the link there, and the ng-binding class is not mentioned anywhere else in the documentation or the guide that I found. Closes #3728 --- .../guide/dev_guide.templates.css-styling.ngdoc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/content/guide/dev_guide.templates.css-styling.ngdoc b/docs/content/guide/dev_guide.templates.css-styling.ngdoc index 529c2398d373..46ae6e960d67 100644 --- a/docs/content/guide/dev_guide.templates.css-styling.ngdoc +++ b/docs/content/guide/dev_guide.templates.css-styling.ngdoc @@ -7,9 +7,17 @@ Angular sets these CSS classes. It is up to your application to provide useful s # CSS classes used by angular +* `ng-scope` + - **Usage:** angular applies this class to any element that where a new {@link api/ng.$rootScope.Scope scope} + is defined. (see {@link guide/scope scope} guide for more information about scopes) + +* `ng-binding` + - **Usage:** angular applies this class to any element that is attached to a data binding, via `ng-bind` or + {{}} curly braces, for example. (see {@link guide/dev_guide.templates.databinding databinding} guide) + * `ng-invalid`, `ng-valid` - **Usage:** angular applies this class to an input widget element if that element's input does - not pass validation. (see {@link api/ng.directive:input input} directive). + not pass validation. (see {@link api/ng.directive:input input} directive) * `ng-pristine`, `ng-dirty` - **Usage:** angular {@link api/ng.directive:input input} directive applies `ng-pristine` class From 508435647fbbdf549a8c86825d0a289c39a1ee1c Mon Sep 17 00:00:00 2001 From: James Daily Date: Thu, 5 Sep 2013 13:16:16 +0100 Subject: [PATCH 14/19] docs(booleanAttrs): improve parameter docs for boolean attributes Closes #3724 --- src/ng/directive/booleanAttrs.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ng/directive/booleanAttrs.js b/src/ng/directive/booleanAttrs.js index a0966da78c94..ad7b4f3f73ef 100644 --- a/src/ng/directive/booleanAttrs.js +++ b/src/ng/directive/booleanAttrs.js @@ -165,7 +165,8 @@ * * @element INPUT - * @param {expression} ngDisabled Angular expression that will be evaluated. + * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy, + * then special attribute "disabled" will be set on the element */ @@ -195,7 +196,8 @@ * * @element INPUT - * @param {expression} ngChecked Angular expression that will be evaluated. + * @param {expression} ngChecked If the {@link guide/expression expression} is truthy, + * then special attribute "checked" will be set on the element */ @@ -225,7 +227,8 @@ * * @element INPUT - * @param {string} expression Angular expression that will be evaluated. + * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy, + * then special attribute "readonly" will be set on the element */ @@ -258,7 +261,8 @@ * * @element OPTION - * @param {string} expression Angular expression that will be evaluated. + * @param {expression} ngSelected If the {@link guide/expression expression} is truthy, + * then special attribute "selected" will be set on the element */ /** @@ -290,7 +294,8 @@ * * @element DETAILS - * @param {string} expression Angular expression that will be evaluated. + * @param {expression} ngOpen If the {@link guide/expression expression} is truthy, + * then special attribute "open" will be set on the element */ var ngAttributeAliasDirectives = {}; From c061fe414c270734fcd8a7d04a1c636e2388c290 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 5 Sep 2013 13:58:21 +0100 Subject: [PATCH 15/19] docs(tutorial): clarify use of inject() in step 9 Closes #3718 --- docs/content/tutorial/step_09.ngdoc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/content/tutorial/step_09.ngdoc b/docs/content/tutorial/step_09.ngdoc index 245a51d53226..a6c4585c83fe 100644 --- a/docs/content/tutorial/step_09.ngdoc +++ b/docs/content/tutorial/step_09.ngdoc @@ -94,7 +94,6 @@ describe('filter', function() { beforeEach(module('phonecatFilters')); - describe('checkmark', function() { it('should convert boolean values to unicode checkmark or cross', @@ -106,8 +105,12 @@ describe('filter', function() { }); -Note that you need to configure our test injector with the `phonecatFilters` module before any of -our filter tests execute. +We must call `beforeEach(module('phonecatFilters'))` before any of +our filter tests execute. This call loads our `phonecatFilters` module into the injector +for this test run. + +Note that we call the helper function, `inject(function(checkmarkFilter) { ... })`, to get +access to the filter that we want to test. See {@link api/angular.mock.inject angular.mock.inject()}. You should now see the following output in the Karma tab: From dfae0e76d2cf9ae343721ff190acd2b9397b26b2 Mon Sep 17 00:00:00 2001 From: Alexander Kaidalov Date: Fri, 23 Aug 2013 01:47:06 +0400 Subject: [PATCH 16/19] docs(tutorial): fix markup for tutorial_04.png diagram --- docs/content/tutorial/step_04.ngdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/tutorial/step_04.ngdoc b/docs/content/tutorial/step_04.ngdoc index fa8be6ed7ef6..e14b3f8dfecd 100644 --- a/docs/content/tutorial/step_04.ngdoc +++ b/docs/content/tutorial/step_04.ngdoc @@ -45,7 +45,7 @@ We made the following changes to the `index.html` template: * First, we added a `