angular.js/src/ng
Chirayu Krishnappa 3d6a89e888 feat($parse): secure expressions by hiding "private" properties
BREAKING CHANGE:
This commit introduces the notion of "private" properties (properties
whose names begin and/or end with an underscore) on the scope chain.
These properties will not be available to Angular expressions (i.e. {{
}} interpolation in templates and strings passed to `$parse`)  They are
freely available to JavaScript code (as before).

Motivation
----------
Angular expressions execute in a limited context.  They do not have
direct access to the global scope, Window, Document or the Function
constructor.  However, they have direct access to names/properties on
the scope chain.  It has been a long standing best practice to keep
sensitive APIs outside of the scope chain (in a closure or your
controller.)  That's easier said that done for two reasons: (1)
JavaScript does not have a notion of private properties so if you need
someone on the scope chain for JavaScript use, you also expose it to
Angular expressions, and (2) the new "controller as" syntax that's now
in increased usage exposes the entire controller on the scope chain
greatly increaing the exposed surface.  Though Angular expressions are
written and controlled by the developer, they (1) typically deal with
user input and (2) don't get the kind of test coverage that JavaScript
code would.  This commit provides a way, via a naming convention, to
allow publishing/restricting properties from controllers/scopes to
Angular expressions enabling one to only expose those properties that
are actually needed by the expressions.
2013-10-30 17:01:51 -07:00
..
directive chore($compile): remove special case for ngIf and ngRepeat 2013-10-30 16:21:02 -07:00
filter style: make jshint happy 2013-10-22 15:32:41 -07:00
anchorScroll.js style: make jshint happy 2013-10-22 15:32:41 -07:00
animate.js style: make jshint happy 2013-10-22 15:32:41 -07:00
browser.js style: make jshint happy 2013-10-22 15:32:41 -07:00
cacheFactory.js style: make jshint happy 2013-10-22 15:32:41 -07:00
compile.js chore($compile): remove special case for ngIf and ngRepeat 2013-10-30 16:21:02 -07:00
controller.js style: make jshint happy 2013-10-22 15:32:41 -07:00
document.js docs(*): simplify doc urls 2012-06-12 00:10:18 -07:00
exceptionHandler.js docs($exceptionHandler): add an example of overriding the handler 2013-09-19 14:51:38 +01:00
filter.js style: make jshint happy 2013-10-22 15:32:41 -07:00
http.js docs(http): add missing brace in the 2nd interceptors example 2013-10-26 18:53:41 +01:00
httpBackend.js style: make jshint happy 2013-10-22 15:32:41 -07:00
interpolate.js style: make jshint happy 2013-10-22 15:32:41 -07:00
interval.js style: make jshint happy 2013-10-22 15:32:41 -07:00
locale.js style: make jshint happy 2013-10-22 15:32:41 -07:00
location.js docs($location): document $location's events 2013-10-26 20:20:42 +01:00
log.js style: make jshint happy 2013-10-22 15:32:41 -07:00
parse.js feat($parse): secure expressions by hiding "private" properties 2013-10-30 17:01:51 -07:00
q.js docs($q): promises are no longer automatically unwrapped, by default 2013-10-26 19:29:27 +01:00
rootElement.js docs(*): simplify doc urls 2012-06-12 00:10:18 -07:00
rootScope.js docs($rootScope): added $eval locals parameter documentation 2013-10-25 23:53:15 -04:00
sce.js style: make jshint happy 2013-10-22 15:32:41 -07:00
sniffer.js style: make jshint happy 2013-10-22 15:32:41 -07:00
timeout.js docs: correct broken links 2013-10-18 15:35:41 -07:00
urlUtils.js style: make jshint happy 2013-10-22 15:32:41 -07:00
window.js docs($window): improve style and clarify wording 2013-07-21 20:24:33 +02:00