Commit Graph

100 Commits

Author SHA1 Message Date
Trey Hunner
a54d4600b3 style: fix whitespace issues
Closes #8277
2014-07-21 14:52:41 -07:00
Igor Minar
af20a8aac6 docs($parse:isecdom): add a section about return values and CoffeeScript
Closes #7973
2014-07-12 20:23:37 -07:00
fuqcool
cf4f85f62b docs(error/$sce/insecurl): fix links to $sce and $sceDelegateProvider 2014-07-08 22:38:49 -07:00
Chris Kuehl
095848915b docs(error/$rootScope/inprog): fix $timeout typo
Closes #8071
2014-07-03 17:32:30 -04:00
Caitlin Potter
c90cefe161 feat(input): support constant expressions for ngTrueValue/ngFalseValue
ngTrueValue and ngFalseValue now support parsed expressions which the parser determines to be constant values.

BREAKING CHANGE:

Previously, these attributes would always be treated as strings. However, they are now parsed as
expressions, and will throw if an expression is non-constant.

To convert non-constant strings into constant expressions, simply wrap them in an extra pair of quotes, like so:

    <input type="checkbox" ng-model="..." ng-true-value="'truthyValue'">

Closes #8041
Closes #5346
Closes #1199
2014-07-02 18:07:37 -04:00
rodyhaddad
77ada4c82d fix($parse): prevent invocation of Function's bind, call and apply
BREAKING CHANGE:
You can no longer invoke .bind, .call or .apply on a function in angular expressions.
This is to disallow changing the behaviour of existing functions
in an unforseen fashion.
2014-06-30 09:25:24 -07:00
rodyhaddad
db713a1c1b refactor($parse): move around previous security changes made to $parse 2014-06-30 09:25:23 -07:00
Dave Wells
2d5a84963e docs(errors/$compile/nonassing): fix reversed attribute and scope property names 2014-06-11 14:51:37 -07:00
Dylan Semler
650f14eb28 docs(error/$compile/tplrt): note that html comments can cause this 2014-06-10 00:52:15 -07:00
Stephen Nancekivell
63ea0c1aac docs(error/$sce/unsafe): suggest including ngSanatize 2014-06-09 19:53:05 -07:00
Peter Bacon Darwin
4124a653d9 docs(error/$rootScope/inprog): improve understanding and diagnosis of the error
See #5549
2014-06-08 19:33:57 +01:00
specialorange
6c3a0519fa docs(error/$injector/unpr): clarify which code is being referred to in the text
Closes #7020
2014-05-21 22:26:43 +01:00
Mathew Foscarini
e16e7df689 docs(minErr): small grammar fix for $compileMinErr ctreq
Closes #7365
2014-05-06 21:26:31 -04:00
Caitlin Potter
4b1695ec61 feat(injector): "strict-DI" mode which disables "automatic" function annotation
This modifies the injector to prevent automatic annotation from occurring for a given injector.

This behaviour can be enabled when bootstrapping the application by using the attribute
"ng-strict-di" on the root element (the element containing "ng-app"), or alternatively by passing
an object with the property "strictDi" set to "true" in angular.bootstrap, when bootstrapping
manually.

JS example:

    angular.module("name", ["dependencies", "otherdeps"])
      .provider("$willBreak", function() {
        this.$get = function($rootScope) {
        };
      })
      .run(["$willBreak", function($willBreak) {
        // This block will never run because the noMagic flag was set to true,
        // and the $willBreak '$get' function does not have an explicit
        // annotation.
      }]);

    angular.bootstrap(document, ["name"], {
      strictDi: true
    });

HTML:

    <html ng-app="name" ng-strict-di>
      <!-- ... -->
    </html>

This will only affect functions with an arity greater than 0, and without an $inject property.

Closes #6719
Closes #6717
Closes #4504
Closes #6069
Closes #3611
2014-04-10 17:51:15 -04:00
wbyoko
545c62ab18 docs(error/index): add header
Closes #6849
2014-03-26 17:21:53 -07:00
Brian Ford
ca1d126005 docs(error/$injector/unpr): use Controller suffix 2014-03-25 17:10:51 -07:00
Igor Minar
008fbe53d1 docs(errors/$injector/nomod): add info about forgetting to load the module file
Closes #3752
2014-03-25 14:11:40 -07:00
Sekib Omazic
c7a49b34c6 docs(error/ng/btstrpd): fix typo in error page
Minimal typo fix

Closes #6803
2014-03-22 16:04:45 -04:00
poshest
c9fbb472b7 docs(errors/$compile/nonassing): update nonassign.ngdoc
It might seem obvious that if you don't supply "bind" attribute in this case, you'll get an error,
but I feel this is worth adding to the doc.

Closes #6725
2014-03-17 16:13:34 -07:00
Takashi Nakagawa
e381c4dd09 chore(formatting): removed unnecessary white spaces 2014-03-17 14:57:29 -07:00
amagee
6b18a564dd docs(error/ng/btstrpd): note that loading angular.js twice can cause the error
Closes #6502
2014-03-02 15:56:13 +00:00
Michele Beltrame
9e16aaf3a9 docs($sce/insecurl): mention port in the same origin policy
Closes #5759

The default trusted origin appears to be the same protocol+domain+port,
non just protocol+domain.
I patched the doc accordingly.
2014-03-01 12:58:20 +01:00
Brad Williams
fd09586b08 docs(errors/infdig): add a common example
Mention common cause of error is binding to a new array on every $digest loop.

Closes #6465
2014-02-26 16:33:59 -08:00
Peter Bacon Darwin
4a6a3ba7fb docs(*): fix anchors for members in api docs 2014-02-21 19:37:37 +00:00
Peter Bacon Darwin
33e1bdc543 chore(errors): rename folders to match namespaces 2014-02-16 22:02:41 +00:00
Peter Bacon Darwin
a564160511 docs(bike-shed-migration): fix url-based links refs to AUTO module 2014-02-16 19:03:41 +00:00
Peter Bacon Darwin
c7e815f63b docs(bike-shed-migration): fix up links outside the domain
It is safer to use markdown style links and save jsdoc style links for
internal links and code references
2014-02-16 19:03:40 +00:00
Jorg
ef210e5e11 fix($http): update httpBackend to use ActiveXObject on IE8 if necessary
window.XMLHttpRequest is not always available in IE8 despite it not running in quirks mode,
in which case Angular should be using the ActiveXObject instead. Just checking the browser
version is taking too many shortcuts.

Closes #5677
Closes #5679
2014-01-31 16:52:42 -08:00
Manan
7a78aed160 docs(compile/nodomevents): fix typo ng-mode -> ng-model
correcting directive name to ng-model instead of ng-mode in nodomevents.ngdoc

Correcting use of ng-model directive

Closes #6036
2014-01-29 08:51:02 -05:00
Igor Minar
6c17d02bc4 fix($httpBackend): use ActiveX XHR when making PATCH requests on IE8
IE8's native XHR doesn't support PATCH requests, but the ActiveX one does.

I'm also removing the noxhr error doc because nobody will ever get that error.

Closes #2518
Closes #5043
2014-01-02 22:04:32 -08:00
Drew Perttula
6a6f71f238 docs(error/ngRepeat/dupes): fix typo
Closes #5610
2014-01-02 21:34:34 -08:00
Ziang Song
41534816a4 docs(error/noregexp): fix link to ng-pattern
Closes #5313
2013-12-18 21:14:10 +00:00
Mattias Holmlund
4ac21ac039 docs(error/transclude/orphan): fix spelling mistakes
Closes #5259
2013-12-12 11:15:31 +00:00
Vojta Jina
4ab16aaaf7 feat($parse): revert hiding "private" properties
Hiding `_*` properties was a feature primarily for developers using Closure compiler and Google JS
style. We didn't realize how many people will be affected by this change.

We might introduce this feature in the future, probably under a config option, but it needs more
research and so I'm reverting the change for now.

This reverts commit 3d6a89e888.

Closes #4926
Closes #4842
Closes #4865
Closes #4859
Closes #4849

Conflicts:
	src/ng/parse.js
2013-11-13 23:25:09 -08:00
Eddie Monge Jr
a59976be18 docs(errors/compile/tplrt): display html block as code
HTML elements were getting parsed by as HTML elements

Closes #4827
2013-11-13 21:06:37 +00:00
Chirayu Krishnappa
9577702e8d fix($resource): don't use $parse for @dotted.member
params and paramDefaults support looking up the parameter value from the
data object.  The syntax for that is `@nested.property.name`.
Currently, $resource uses $parse to do this.  This is too liberal
(you can use values like `@a=b` or `@a | filter` and have it work -
which doesn't really make sense).  It also puts up a dependency on
$parse which is has restrictions to secure expressions used in
templates.  The value here, though a string, is specified in Javascript
code and shouldn't have those restrictions.
2013-11-11 16:17:34 -08:00
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
Pete Bacon Darwin
0bbb9e6258 docs(error/compile/tplrt): split long lines 2013-10-26 20:14:08 +01:00
gdennie
81d5bc860d docs(error/compile/tplrt): clarify and grammar
Closes #4503
2013-10-26 20:14:08 +01:00
gdennie
9f2c8e935a Clarification stemming from my own issues
It is instructive to give literal examples that reflect common (my) experience of the problem. :)
2013-10-26 20:09:09 +01:00
CloudDueling.com
db9c6a3528 docs(error/multidir): improve the sentence fluency
Closes #4449
2013-10-24 22:21:27 +01:00
G.H. Naylor
d3930fdfd9 docs(modulerr): fix typo
Closes #4418
2013-10-24 20:51:32 +01:00
Brian Ford
e69c287293 docs(guide/directive,guide/compiler,): drastically improve 2013-10-23 14:17:27 -07:00
Vojta Jina
14438058da docs: correct broken links
This also contains some whitespace corrections by my editor.
2013-10-18 15:35:41 -07:00
Igor Minar
dba566a96d docs($rootScope): better document infinite digest and ttl 2013-10-15 11:28:47 -07:00
Peter Bacon Darwin
7a586e5c19 fix(*): protect calls to hasOwnProperty in public API
Objects received from outside AngularJS may have had their `hasOwnProperty`
method overridden with something else. In cases where we can do this without
incurring a performance penalty we call directly on Object.prototype.hasOwnProperty
to ensure that we use the correct method.

Also, we have some internal hash objects, where the keys for the map are provided
from outside AngularJS. In such cases we either prevent `hasOwnProperty` from
being used as a key or provide some other way of preventing our objects from
having their `hasOwnProperty` overridden.

BREAKING CHANGE: Inputs with name equal to "hasOwnProperty" are not allowed inside
form or ngForm directives.

Before, inputs whose name was "hasOwnProperty" were quietly ignored and not added
to the scope.  Now a badname exception is thrown.

Using "hasOwnProperty" for an input name would be very unusual and bad practice.
Either do not include such an input in a `form` or `ngForm` directive or change
the name of the input.

Closes #3331
2013-10-07 09:01:13 -07:00
Chirayu Krishnappa
93ce5923e9 feat($sce): simpler patterns for $sceDelegateProviders white/blacklists
Closes #4006
2013-10-01 00:41:07 -07:00
jankuca
5a1a6b86a8 fix(ngTransclude): detect ngTranslude usage without a transclusion directive
Closes #3759
2013-09-30 16:44:19 -07:00
Brian Ford
8727fce312 docs(minerr): add note about ngRoute in injector/modulerr 2013-09-30 11:34:49 -07:00
Brian Ford
eea76a0ebe docs(minerr): fix broken style from long line in nonassign 2013-09-26 14:13:02 -07:00