Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Added local to SanitizationWhitelist #8787

Closed
wants to merge 180 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
1aaa43f
Added local to SanitizationWhitelist
jorgecasar Aug 26, 2014
9f38de6
Updated sanitizeUriSpec for local urls
jorgecasar Aug 27, 2014
a02f056
feat(minErr): allow specifying ErrorConstructor in minErr constructor
jeffbcross Aug 21, 2014
fb96c17
chore($q): convert thrown Error to $minErr when calling $q constructo…
jeffbcross Aug 21, 2014
e5b328e
chore($q): replace plain TypeError with minErr+TypeError in cyclical …
jeffbcross Aug 21, 2014
c5a3be4
docs($q): correct @ngdoc annotations for methods of $q
caitp Aug 26, 2014
32cb191
chore(tests): use jquery again in e2e tests
tbosch Aug 26, 2014
331d545
feat(filter): allow to define the timezone for formatting dates
tbosch Aug 25, 2014
0c78edc
fix(input): use year 1970 instead of 1900 for `input[time]`
tbosch Aug 26, 2014
eecc130
feat(input): allow to define the timezone for parsing dates
tbosch Aug 25, 2014
afe7bfc
fix(input): allow to use seconds in `input[time]` and `input[datetime…
tbosch Aug 26, 2014
c7921e7
refactor(nodeName_): remove IE8 specific branch
IgorMinar Aug 26, 2014
c5671f4
perf(nodeName_): simplify the code and reduce the number of DOM calls
IgorMinar Aug 26, 2014
718d5cf
refactor(hashKey): don't generate memory garbage
IgorMinar Aug 26, 2014
f0a49ca
fix(ngModel): treat undefined parse responses as parse errors
matsko Aug 19, 2014
51f807d
feat(ngModel): provide validation API functions for sync and async va…
matsko Jul 19, 2014
520b941
feat($rootScope): implement $applyAsync to support combining calls to…
caitp Aug 22, 2014
f0e209a
feat($http): implement mechanism for coalescing calls to $apply in $http
caitp Aug 22, 2014
c305fdd
docs(shallowCopy): add missing word 'are' and period.
nebulou5 Aug 27, 2014
8ba14c6
fix(Angular): remove duplicate nodeName_ references
IgorMinar Aug 27, 2014
97325bb
chore(build): uprade closure-compiler to v20140814
IgorMinar Aug 27, 2014
0e2ec30
docs(compile): `translcuded` -> `transcluded`
zzmp Aug 27, 2014
711ee0d
fix($browser): detect changes to the browser url that happened in sync
tbosch Aug 26, 2014
bbc0f90
feat($templateRequest): introduce the $templateRequest service
matsko Aug 12, 2014
cb8364c
fix($animate): ensure guarded animations consider AJAX requests upon …
matsko Aug 28, 2014
5e9d270
feat($compile/ngBind): allow disabling binding info
petebacondarwin Aug 23, 2014
e528ed8
feat($compile): allow disabling scope info
petebacondarwin Aug 23, 2014
716e65a
test(input): dealoc elements
vojtajina Aug 27, 2014
8b413f8
test(ngClass): dealoc elements
vojtajina Aug 27, 2014
f7f4e34
feat: add angular.reloadWithDebugInfo()
petebacondarwin Aug 23, 2014
6fd2611
chore(clean-shrinkwrap): chokidar is fixed since 0.8.2
petebacondarwin Aug 23, 2014
b864ca5
chore(deps): update protractor to 1.1.1
vojtajina Aug 26, 2014
3d1151c
test(e2e): fix by.binding() locators
petebacondarwin Aug 25, 2014
401e880
refactor($compile): $$addBindingInfo accepts single expression or an …
vojtajina Aug 26, 2014
ab8bd91
refactor: remove doReload arg used only for testing
vojtajina Aug 26, 2014
d8b047a
refactor($compile): $$addScopeInfo always expects jq wrapper
vojtajina Aug 27, 2014
b826353
refactor($compile): rename element -> $element
vojtajina Aug 27, 2014
816e577
perf($compile): add debug classes in compile phase
vojtajina Aug 27, 2014
82725e5
refactor(ngBind): name link and compile functions
vojtajina Aug 27, 2014
636dbca
docs(debugInfo): add docs for $compileProvider.debugInfoEnabled()
btford Aug 27, 2014
e5b58c0
test($animate): add tests for noop enaled and cancel methods
matsko Aug 28, 2014
c74e1f4
chore(benchmarks): disable debugInfo in largetable benchmark
IgorMinar Aug 28, 2014
9b940f9
fix(ngModel): allow non-assignable binding when getterSetter is used
shahata Aug 22, 2014
8ac8b5f
docs(ngModelOptions): fix example
timkindberg Aug 28, 2014
544416d
fix(ngEventDirs): execute `blur` and `focus` expression using `scope.…
tbosch Aug 27, 2014
efc5e20
feat(ngRoute): alias string as redirectTo property in .otherwise()
Jun 12, 2014
50461aa
feat(filterFilter): pass index to function predicate
colincasey Sep 21, 2013
dae965d
feat(testability): add $$testability service
juliemr Jun 10, 2014
6021ec3
docs(filterFilter): add note on negation
guilbep Jul 8, 2014
4103fcf
fix($compile): use the correct namespace for transcluded svg elements
tbosch Aug 28, 2014
b5611f0
feat($compile): bind isolate scope properties to controller
caitp Aug 21, 2014
72b597a
fix(ngBindHtml): throw error if interpolation is used in expression
rodyhaddad Aug 28, 2014
1475fba
docs($filter): Date filter am/pm case
SekibOmazic Aug 26, 2014
9a947f8
chore(compare-master-to-stable): make checks for bugfixes better
caitp Aug 27, 2014
54883f3
fix(input): validate minlength/maxlength for non-string values
caitp Jun 24, 2014
16146ef
fix(ngModel): always format the viewValue as a string for text, url a…
matsko Aug 28, 2014
a13926a
docs($q): fixed spelling, removed extra characters
Aug 26, 2014
a315385
docs(FormController): document $submitted property
zahragh Aug 22, 2014
be191f4
docs($rootScope): remove duplicate `$digest()`
gitMbar Aug 29, 2014
6f3fb7e
perf(select): execute render after $digest cycle
wesleycho Aug 29, 2014
33fb328
fix(currencyFilter): pass through null and undefined values
IgorMinar Aug 29, 2014
60c5aac
fix(numberFilter): pass through null and undefined values
IgorMinar Aug 29, 2014
765d540
fix(ngSwitch): avoid removing DOM nodes twice within watch operation
matsko Aug 29, 2014
a557c6e
fix($animate): wait two until two digests are over until enabling ani…
matsko Aug 29, 2014
0c8ece4
fix(ngRepeat): improve errors for duplicate items
smilli Aug 23, 2014
2a2cdae
refactor(locationSpec): make helper functions take an object
tbosch Aug 29, 2014
9b8aef4
fix($location): always resolve relative links in html5mode to `<base>…
tbosch Aug 29, 2014
51c14fb
fix(docs): don't throw exception on the 404 page
IgorMinar Aug 29, 2014
504d6a8
fix(docs): only check for SEVERE logs in tests
tbosch Aug 29, 2014
ff80a52
docs(changelog): release notes for 1.3.0-RC.0 sonic-boltification
matsko Aug 30, 2014
9ce7e8f
chore(travis): move docse2e tests into the unit tests vm
IgorMinar Aug 30, 2014
46ed545
docs(errors): fix link in the $location:nobase error page
IgorMinar Aug 31, 2014
6b0d502
docs(CHANGELOG.md): add breaking change from 5f3f25a1
caitp Sep 1, 2014
92adabc
refactor(ngRepeat): specify explicit `false` for cloneNode deepClone …
caitp Sep 2, 2014
ef6e70c
docs($compile): clarify linking when there are `templateUrl` directives
petebacondarwin Sep 2, 2014
3e3ec73
fix($location): set `baseHref` in mock browser to `/`
tbosch Sep 2, 2014
9023a95
docs(errors): fix base href in $location:nobase error page
tbosch Sep 2, 2014
025adc6
fix(input): check `scope.$$phase` only on `$rootScope`
shahata Aug 29, 2014
5d3ff22
fix(ngEventDirs): check `scope.$$phase` only on `$rootScope`
shahata Aug 29, 2014
b6d2abb
style(ngModel): fix spacing
btford Sep 2, 2014
3eed451
docs(guide/providers): fix grammar and punctuation
Aug 31, 2014
77837df
docs(changelog): fix inline formatting
fixe Aug 30, 2014
6892d44
docs($rootScope): document scope properties
shahata Aug 16, 2014
f9e8038
docs(ngRepeat): update step_02.ngdoc with challenge
nicolaiskogheim Aug 24, 2014
0704219
style(ngModel): fix indentation
btford Sep 2, 2014
a1603bc
test(orderBy): implement benchmark for ngRepeat with orderBy
Zizzamia Aug 28, 2014
425b64e
chore(package.json): update to dgeni-packages v0.9.8
petebacondarwin Sep 3, 2014
9949ef5
refactor(ngSwitch): remove undocumented `change` attribute from ngSwitch
thebigredgeek Aug 30, 2014
dc25846
refactor(ngModel): get rid of revalidate
shahata Aug 30, 2014
068a76d
fix(ngForm): don't clear validity of whole form when removing control
shahata Aug 30, 2014
3e132ec
docs(jsdoc): remove `@kind function` for providers
thorn0 Aug 28, 2014
0dce82e
refactor(indexOf) use Array.prototype.indexOf exclusively
realityking Aug 29, 2014
8d46c0f
test($location): fix use of browserTrigger
petebacondarwin Sep 3, 2014
b9b9e8c
chore(orderby-bp): fix the benchmark code and add jquery support
IgorMinar Sep 3, 2014
25d5a41
docs(ngModelController): fix $asyncValidators example
twhitbeck Sep 3, 2014
c3cced4
chore(shrink-wrap): update shrinkwrap to latest benchpress
jeffbcross Sep 3, 2014
29ae244
docs(CHANGELOG.md): add breaking change for a9fcb0d0 (v1.2.13)
caitp Sep 3, 2014
e22b867
docs(ngSwitch): fix priority
thammin Sep 3, 2014
be48546
docs(ngBlur): explain blur events
zymsys Aug 29, 2014
76f6193
docs(interpolate): fix link text
zzmp Aug 28, 2014
22afe95
docs(tutorial/step_05): improve formatting of code identifier
theLearningChan Aug 10, 2014
f6f5d5c
docs(README): fix 'Contribution guidelines' link
thorn0 Aug 28, 2014
3019cf1
docs($sce:unsafe): fix link to $sce docs
juampynr Aug 6, 2014
717c36c
docs(docs.css): improve comma spacing in TOC on mobile
thorn0 Aug 11, 2014
ddeee21
fix(numberFilter): format numbers that round to zero as nonnegative
smilli Aug 23, 2014
0b8380a
docs($http): clarify overriding of default transformations
petebacondarwin Sep 4, 2014
c7a3de4
fix($compile): render nested transclusion at the root of a template
petebacondarwin Sep 4, 2014
b58e1cc
fix(ngSwitch): ensure correct iterator is passed to async function
thebigredgeek Sep 4, 2014
310f115
refact(ngSwitch): don't create extra function in for loop
petebacondarwin Sep 4, 2014
4cbe7b5
chore(docs): improve searching by member
petebacondarwin Sep 4, 2014
931b539
fix(ngModel): revalidate the model when min/max expression values cha…
matsko Sep 3, 2014
e723e6b
fix(ngModel): consider ngMin/ngMax values when validating number inpu…
matsko Sep 3, 2014
6cfc264
fix(ngModel): revalidate the model when min/max expression values cha…
matsko Sep 3, 2014
fc7a94c
fix(ngModel): properly parse min/max date values as strings for date …
matsko Sep 4, 2014
73cb96f
test(ngModel): add missing tests for ngMin/ngMax for date inputs
matsko Sep 4, 2014
f1af3ff
chore(docs): enable page ordering by @sortOrder tag
petebacondarwin Sep 4, 2014
4fb73d1
docs(guide): add sortOrder to each page
petebacondarwin Sep 4, 2014
99a5700
fix($location): allow numeric location setter arguments
pkozlowski-opensource Apr 19, 2014
a5a284e
docs($location): update search description to include number param
johnnyreilly Aug 26, 2014
65397c9
fix($location): remove an unused parameter of $location.url
thorn0 Aug 28, 2014
567ac06
fix($location): don't call toString on null values
jeffbcross Sep 5, 2014
57ccbf2
refactor(indexOf) Remove a now unused copy of the indexOf function
realityking Sep 4, 2014
e48c3a3
fix(orderBy): allow arrayLike objects to be ordered
tsevan Sep 5, 2014
8612d6f
chore(tests): update Protractor to v1.2.0
juliemr Sep 5, 2014
e867088
fix(ngAnimate): support removing classes from SVG elements when using…
caitp Sep 2, 2014
a82487e
fix(ngModelOptions): do not trigger digest on `setViewValue` if debou…
shahata Aug 29, 2014
83ec936
refactor($http): simplify buildUrl function
pkozlowski-opensource Sep 5, 2014
431df9a
refactor($parse): simplifying multi-statement execution
jbedard Aug 31, 2014
3ec8dbd
refactor($parse): adding function names for easier debugging
jbedard Aug 31, 2014
58251e4
perf($parse): calculate array lengths once at start of loop
jbedard Aug 31, 2014
fd0d037
refactor($parse): simplifying some while(true) loops
jbedard Sep 2, 2014
26767a6
perf($parse): removing references to Parser/Lexer from parsed express…
jbedard Sep 2, 2014
222a36c
perf(jQuery): only trigger $destroy if a handler exists
jbedard Aug 30, 2014
0243d8e
chore(package.json): tidy up dependencies
petebacondarwin Sep 8, 2014
9f6dce0
chore(bower): refactor bower usage
petebacondarwin Sep 8, 2014
aed4363
docs(form): move param tag outside of main description
petebacondarwin Sep 8, 2014
cda4e82
docs($filter): remove duplicate documentation of register method
petebacondarwin Sep 8, 2014
d5536f2
refactor(select): remove code duplication
IgorMinar Sep 8, 2014
167e4c1
feat(angular.forEach): add the array/object as the 3rd param like the…
jbedard Jun 15, 2014
c32edaf
perf(extend): remove use of forEach to remove calls/closures/passing …
jbedard Sep 3, 2014
21c1442
docs($location): clarify guide regarding link handling
tbosch Sep 3, 2014
00068e8
refactor(ngModelController,formController): centralize and simplify l…
tbosch Sep 5, 2014
05861fe
chore(npm-shrinkwrap): fix karma dependencies
petebacondarwin Sep 9, 2014
472588e
chore(npm-shrinkwrap): safely update karma to 0.12.23
petebacondarwin Sep 9, 2014
5169570
test(ngRepeat): move an existing test into the right describe block
IgorMinar Sep 9, 2014
547f781
test(animateSpec): remove unused variables
IgorMinar Sep 9, 2014
4463e64
chore(testabilityPatch): fix the dump fn so that it works with karma'…
IgorMinar Sep 9, 2014
469c9d7
fix(ngRepeat): preserve original position of elements that are being …
IgorMinar Sep 9, 2014
ab3c196
chore(.jshintrc): add jqLiteBuildFragment to globals
caitp Sep 8, 2014
b391df8
chore(.jshintrc): add jqLiteParseHTML to globals
caitp Sep 8, 2014
159aa3e
fix(ngInclude): correctly add svg-namespaced template content
caitp Sep 8, 2014
b7c1c1d
fix($parse): disallow passing Function to Array.sort
chirayuk Sep 8, 2014
baef4e9
revert: "fix($compile): render nested transclusion at the root of a t…
jeffbcross Sep 9, 2014
fdee3aa
docs(ngModel): update breaking change from 1.3.0-beta.11 to 1.3.0-bet…
tbosch Sep 9, 2014
425b3bc
test($parse): adding benchmark for execution of $parse()ed expressions
jbedard Sep 5, 2014
0755ae0
perf($parse): remove getterFn wrapper for internal use
jbedard Sep 3, 2014
56aaae3
docs: add perf todo notes from #8515
IgorMinar Sep 9, 2014
dc7b296
refactor(ngModel): remove $$invalidModelValue and refactor methods
tbosch Sep 9, 2014
9715f3b
fix(ngModel): render immediately also with async validators
tbosch Sep 9, 2014
722b04f
fix(ngModel): update model value with async validators correctly
tbosch Sep 9, 2014
1b6ccc7
feat(ngModelOptions): add allowInvalid option
shahata Jul 24, 2014
90307f7
docs(CHANGELOG.md): add changes for 1.3.0-rc.1 and 1.2.24
jeffbcross Sep 9, 2014
1f3861d
docs(CHANGELOG.md): fix wording and remove reverted change
jeffbcross Sep 9, 2014
57191df
docs(CHANGELOG.md): add upcoming breaking change
jeffbcross Sep 9, 2014
82423e8
docs(api/index): fix strange uses of the word namespace
petebacondarwin Sep 10, 2014
8d94172
docs(angular.testability): add jsdoc marker to ensure it is included …
petebacondarwin Sep 10, 2014
0b49073
docs(angular.getTestability): unpublish the function as it is not public
petebacondarwin Sep 10, 2014
21263c1
fix(ngModel): don’t clear the model when an external validator failed
tbosch Sep 10, 2014
a35e5a8
perf($compile): move $$isolateBinding creation to directive factory i…
jbedard Aug 15, 2014
ec229ba
docs(ngResource): document steps to skip default json serialization/d…
Aug 22, 2014
4579d2a
docs(tutorial): update step 7 to reference angular-phonecat
rush340 Aug 21, 2014
0d949d8
fix(input): always pass in the model value to `ctrl.$isEmpty`
tbosch Sep 10, 2014
85b54cb
fix(ngModel): do not reset bound date objects
btford Aug 29, 2014
986116e
docs(tutorial/steps-11&12): add warning about bower conflict error
petebacondarwin Sep 10, 2014
bd17b20
feat(limitTo): support numeric input to limitTo
hjast Sep 5, 2014
097c2fc
fix(i18n): fix typo at i18n generation code
lgalfaso Sep 5, 2014
43737ab
fix(ngResource): make badcfg error message more helpful
caitp Sep 10, 2014
112c435
docs(guide/providers): note that services can create functions
mattduggan Sep 10, 2014
8d7e894
chore(ngLocale): Include numberformatsymbolext.js in Closure Slurper …
mgallag Sep 9, 2014
559d6ee
fix(ngLocale): Regenerate Locale Files
caitp Sep 11, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ performance/temp*.html
*.swp
angular.js.tmproj
/node_modules/
/components/
/bower_components/
bower_components/
angular.xcodeproj
.idea
.agignore
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:
- JOB=unit
- JOB=e2e TEST_TARGET=jqlite
- JOB=e2e TEST_TARGET=jquery
- JOB=e2e TEST_TARGET=doce2e
global:
- SAUCE_USERNAME=angular-ci
- SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
Expand Down
597 changes: 597 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ it makes development fun!
* Tutorial: http://docs.angularjs.org/tutorial
* API Docs: http://docs.angularjs.org/api
* Developer Guide: http://docs.angularjs.org/guide
* Contribution guidelines: http://docs.angularjs.org/misc/contribute
* Contribution guidelines: [CONTRIBUTING.md](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md)
* Dashboard: http://dashboard.angularjs.org

Building AngularJS
Expand All @@ -37,7 +37,7 @@ To execute end-to-end (e2e) tests, use:
grunt test:e2e

To learn more about the grunt tasks, run `grunt --help` and also read our
[contribution guidelines](http://docs.angularjs.org/misc/contribute).
[contribution guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md).


[![Analytics](https://ga-beacon.appspot.com/UA-8594346-11/angular.js/README.md?pixel)](https://github.com/igrigorik/ga-beacon)
Expand Down
2 changes: 2 additions & 0 deletions angularFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ var angularFiles = {
'src/ng/sanitizeUri.js',
'src/ng/sce.js',
'src/ng/sniffer.js',
'src/ng/templateRequest.js',
'src/ng/testability.js',
'src/ng/timeout.js',
'src/ng/urlUtils.js',
'src/ng/window.js',
Expand Down
6 changes: 6 additions & 0 deletions benchmarks/largetable-bp/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
var app = angular.module('largetableBenchmark', []);

app.config(function($compileProvider) {
if ($compileProvider.debugInfoEnabled) {
$compileProvider.debugInfoEnabled(false);
}
});

app.filter('noop', function() {
return function(input) {
return input;
Expand Down
48 changes: 48 additions & 0 deletions benchmarks/orderby-bp/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
var app = angular.module('orderByBenchmark', []);

app.controller('DataController', function($rootScope, $scope) {
this.ngRepeatCount = 5000;
this.rows = [];
var self = this;

$scope.benchmarkType = 'basic';

$scope.rawProperty = function(key) {
return function(item) {
return item[key];
};
};

// Returns a random integer between min (included) and max (excluded)
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}

benchmarkSteps.push({
name: 'setup',
description: 'Set rows to empty array and apply, then push new rows to be applied in next step',
fn: function() {
var oldRows = self.rows;
$rootScope.$apply(function() {
self.rows = [];
});
self.rows = oldRows;
if (self.rows.length !== self.ngRepeatCount) {
self.rows = [];
for (var i = 0; i < self.ngRepeatCount; i++) {
self.rows.push({
'name': getRandomInt(i, (i + 40)),
'index': i
});
}
}
}
})

benchmarkSteps.push({
name: '$apply',
fn: function() {
$rootScope.$apply();
}
});
});
14 changes: 14 additions & 0 deletions benchmarks/orderby-bp/bp.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = function(config) {
config.set({
scripts: [
{
"id": "jquery",
"src": "jquery-noop.js"
},{
id: 'angular',
src: '/build/angular.js'
},{
src: 'app.js',
}]
});
};
82 changes: 82 additions & 0 deletions benchmarks/orderby-bp/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<div class="container-fluid" ng-app="orderByBenchmark">
<div class="row" ng-controller="DataController as ctrl">
<div class="col-lg-8">
<p>Filters</p>

<p>
<label>Number of ngRepeats:</label>
<input type="number" ng-model="ctrl.ngRepeatCount">
</p>

<p>
<div class="radio">
<label>
<input type="radio" ng-model="benchmarkType" value="baseline">baseline
</label>
</div>
<pre><code>ng-repeat="row in ctrl.rows"</code></pre>
<br />
<div class="radio">
<label>
<input type="radio" ng-model="benchmarkType" value="orderBy">orderBy
</label>
</div>
<pre><code>ng-repeat="row in ctrl.rows | orderBy:'name'"</code></pre>
<br />
<div class="radio">
<label>
<input type="radio" ng-model="benchmarkType" value="orderByArray">orderBy array expression
</label>
</div>
<pre><code>ng-repeat="row in ctrl.rows | orderBy:['name', 'index']"</code></pre>
<br />
<div class="radio">
<label>
<input type="radio" ng-model="benchmarkType"
value="orderByFunction">orderBy function expression
</label>
</div>
<pre><code>ng-repeat="row in ctrl.rows | orderBy:rawProperty('name')"</code></pre>
<br />
<div class="radio">
<label>
<input type="radio" ng-model="benchmarkType"
value="orderByArrayFunction">orderBy array function expression
</label>
</div>
<pre><code>ng-repeat="row in ctrl.rows | orderBy:[rawProperty('name'), rawProperty('index')]"</code></pre>
</p>


Debug output:
<ng-switch on="benchmarkType">
<div ng-switch-when="baseline">
<span ng-repeat="row in ctrl.rows">
<span ng-bind="row.name"></span>,
</span>
</div>
<div ng-switch-when="orderBy">
<span ng-repeat="row in ctrl.rows | orderBy:'name'">
<span ng-bind="row.name"></span>,
</span>
</div>
<div ng-switch-when="orderByArray">
<span ng-repeat="row in ctrl.rows | orderBy:['name', 'index']">
<span ng-bind="row.name"></span>,
</span>
</div>
<div ng-switch-when="orderByFunction">
<span ng-repeat="row in ctrl.rows | orderBy:rawProperty('name')">
<span ng-bind="row.name"></span>,
</span>
</div>
<div ng-switch-when="orderByArrayFunction">
<span ng-repeat="row in ctrl.rows | orderBy:[rawProperty('name'), rawProperty('index')]">
<span ng-bind="row.name"></span>,
</span>
</div>
</ng-switch>

</div>
</div>
</div>
86 changes: 86 additions & 0 deletions benchmarks/parsed-expressions-bp/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
var app = angular.module('parsedExpressionBenchmark', []);

app.config(function($compileProvider) {
if ($compileProvider.debugInfoEnabled) {
$compileProvider.debugInfoEnabled(false);
}
});

app.filter('noop', function() {
return function(input) {
return input;
};
});

//Executes the specified expression as a watcher
app.directive('bmPeWatch', function() {
return {
restrict: 'A',
compile: function($element, $attrs) {
$element.text( $attrs.bmPeWatch );
return function($scope, $element, $attrs) {
$scope.$watch($attrs.bmPeWatch, function(val) {
$element.text(val);

});
};
}
};
});

//Executes the specified expression as a watcher
//Adds a simple wrapper method to allow use of $watch instead of $watchCollection
app.directive('bmPeWatchLiteral', function($parse) {
function retZero() {
return 0;
}

return {
restrict: 'A',
compile: function($element, $attrs) {
$element.text( $attrs.bmPeWatchLiteral );
return function($scope, $element, $attrs) {
$scope.$watch( $parse($attrs.bmPeWatchLiteral, retZero) );
};
}
};
});

app.controller('DataController', function($scope, $rootScope) {
var totalRows = 10000;

var data = $scope.data = [];

var star = '*';

$scope.func = function() { return star;};

for (var i=0; i<totalRows; i++) {
data.push({
index: i,
odd: i%2 === 0,
even: i%2 === 1,
str0: "foo-" + Math.random()*Date.now(),
str1: "bar-" + Math.random()*Date.now(),
str2: "baz-" + Math.random()*Date.now(),
num0: Math.random()*Date.now(),
num1: Math.random()*Date.now(),
num2: Math.random()*Date.now(),
date0: new Date(Math.random()*Date.now()),
date1: new Date(Math.random()*Date.now()),
date2: new Date(Math.random()*Date.now()),
func: function(){ return star; },
obj: data[i-1],
keys: data[i-1] && (data[i-1].keys || Object.keys(data[i-1]))
});
}

benchmarkSteps.push({
name: '$apply',
fn: function() {
for (var i=0; i<50; i++) {
$rootScope.$digest();
}
}
});
});
11 changes: 11 additions & 0 deletions benchmarks/parsed-expressions-bp/bp.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = function(config) {
config.set({
scripts: [ {
id: 'angular',
src: '/build/angular.js'
},
{
src: 'app.js',
}]
});
};
Loading