Commit Graph

115 Commits

Author SHA1 Message Date
Michał Gołębiowski
e63f670ff2 docs(content): update Angular 1.2 mentions to Angular 1.3
Angular 1.3 docs now describe the process of using this version instead of
the older 1.2 that is the latest stable version.

Also, update jQuery 1.10.x mentions to 2.1.x.
2014-10-08 10:59:54 -07:00
Michał Gołębiowski
6fd36deed9 feat($location): add support for History API state handling
Adds $location state method allowing to get/set a History API state via
pushState & replaceState methods.

Note that:
- Angular treats states undefined and null as the same; trying to change
one to the other without touching the URL won't do anything. This is necessary
to prevent infinite digest loops when setting the URL to itself in IE<10 in
the HTML5 hash fallback mode.
- The state() method is not compatible with browsers not supporting
the HTML5 History API, e.g. IE 9 or Android < 4.0.

Closes #9027
2014-10-07 15:48:10 -07:00
Rouven Weßling
f52203ce71 refactor($http) Simplify code by removing workarounds for older versions of Internet Explorer
This removes a workaround for IE 8 and and error handling for IE6.

Closes #9300
2014-10-06 16:33:19 -07:00
Tobias Bosch
a0bfdd0d60 fix(input): correctly handle invalid model values for input[date/time/…]
Similar to `input[number]` Angular will throw if the model value
for a `input[date]` is not a `Date` object.
For `Invalid Date`s (dates whose `getTime()` is `NaN`) `input[date]`
will render an empty string.

Closes #8949
Closes #9375
2014-10-01 16:12:05 -07:00
Brian Feister
313d7956e4 docs(minerr/unpr): note that ctrls cant depend on other ctrls 2014-09-30 14:36:08 -07:00
Jeff Cross
dc3de7fb7a feat($location): add ability to opt-out of <base/> tag requirement in html5Mode
This feature allows disabling Angular's requirement of using a <base/> tag
when using location in html5Mode, for applications that do not require
using $location in html5Mode in IE9. To accomplish this, the $locationProvider.html5Mode 
method has been changed to accept a definition object which can optionally set a 
requireBase property to false, removing the requirement of a <base> tag being present
when html5Mode is enabled.

BREAKING CHANGE: The $location.html5Mode API has changed to allow enabling html5Mode by
    passing an object (as well as still supporting passing a boolean). Symmetrically, the
    method now returns an object instead of a boolean value.

    To migrate, follow the code example below:

    Before:

    var mode = $locationProvider.html5Mode();

    After:

    var mode = $locationProvider.html5Mode().enabled;

Fixes #8934
2014-09-23 11:34:24 -07:00
Jose Martinez
8428a0adef docs(error/$controller/noscp): fix example
Fix the "correct" example to have the proper syntax for creating the locals
object and provide a more explicit explanation as to how the scope object
should be provided.
2014-09-17 10:56:21 -07:00
Juampy
0ee0ce18c1 docs($sce:unsafe): fix link to $sce docs
The second link to Strict Contextual Escaping (SCE) points to a 404.

Closes #8514
2014-09-03 16:31:06 -04:00
Tobias Bosch
995a8d39af docs(errors): fix base href in $location:nobase error page 2014-09-02 10:21:41 -07:00
Igor Minar
2e0982c1ec docs(errors): fix link in the $location:nobase error page 2014-08-31 11:03:59 -07:00
Tobias Bosch
22948807e3 fix($location): always resolve relative links in html5mode to <base> url
BREAKING CHANGE (since 1.2.0 and 1.3.0-beta.1):

Angular now requires a `<base>` tag when html5 mode of `$location` is enabled. Reasoning:
Using html5 mode without a `<base href="...">` tag makes relative links for images, links, ...
relative to the current url if the browser supports
the history API. However, if the browser does not support the history API Angular falls back to using the `#`,
and then all those relative links would be broken.

The `<base>` tag is also needed when a deep url is loaded from the server, e.g. `http://server/some/page/url`.
In that case, Angular needs to decide which part of the url is the base of the application, and which part
is path inside of the application.

To summarize: Now all relative links are always relative to the `<base>` tag.

Exception (also a breaking change):
Link tags whose `href` attribute starts with a `#` will only change the hash of the url, but nothing else
(e.g. `<a href="#someAnchor">`). This is to make it easy to scroll to anchors inside a document.

Related to #6162
Closes #8492

BREAKING CHANGE (since 1.2.17 and 1.3.0-beta.10):

In html5 mode without a `<base>` tag on older browser that don't support the history API
relative paths were adding up. E.g. clicking on `<a href="page1">` and then on `<a href="page2">`
would produce `$location.path()==='/page1/page2'. The code that introduced this behavior was removed
and Angular now also requires a `<base>` tag to be present when using html5 mode.

Closes #8172, #8233
2014-08-29 15:19:51 -07:00
Jeff Cross
0462b688f9 chore($q): replace plain TypeError with minErr+TypeError in cyclical resolve check 2014-08-26 12:33:51 -07:00
Jeff Cross
1b331f3729 chore($q): convert thrown Error to $minErr when calling $q constructor without resolver 2014-08-26 12:09:26 -07:00
Caitlin Potter
09b298705f fix(ngRepeat): make allowed aliasAs expressions more strict
Ensure that aliasAs expressions are valid simple identifiers. These are still assigned to $scope in the same way
that they were previously, however now you won't accidentally create a property named "filtered.collection".

This change additionally restricts identifiers to prevent the use of certain ECMAScript reserved words ("null",
"undefined", "this" --- should probably add "super", "try", "catch" and "finally" there too), as well as certain
properties used by $scope or ngRepeat, including $parent, $index, $even, $odd, $first, $middle, or $last.

Closes #8438
Closes #8440
2014-08-21 18:58:54 -04:00
Ken Sheedlo
38db2d4cec docs(error/$injector/unpr): inadvertently redefining a module can cause error
Closes #8421
2014-07-31 20:48:20 +01:00
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