Commit graph

2812 commits

Author SHA1 Message Date
Nelson Blaha
d57613cd6d docs(tutorial): add experiment showing reverse sort 2013-06-27 19:36:26 +01:00
Jeffrey Palmer
f810940600 docs(guide/controller): fix an error in the scope inheritance example
The chained scope creation example at the bottom of this document was using the childCtrl to create the babyScope, instead of the childScope.
2013-06-25 23:54:17 +01:00
Pete Bacon Darwin
73f8112032 fix(doc-gen): correctly transform index files
Closes #3021
2013-06-25 21:17:36 +01:00
Pete Bacon Darwin
71bc1b761d chore(doc_gen): add task to run doc-gen specs 2013-06-25 21:17:09 +01:00
Domenic Denicola
00d890c07a docs(guide/expression): remove reference to NullPointerException 2013-06-25 21:13:32 +01:00
Igor Minar
aef0980063 fix($location): default to / for the url base if no base[href]
With the recent refactoring of $location service we changed this behavior
resulting in a regression.

Previously we thought that html5 mode always required base[href]
to be set in order for urls to resolve properly. It turns out that
base[href] is problematic because it makes anchor urls (#foo) to
always resolve to the base url, which is almost always incorrect
and results in all anchors links and other anchor urls (e.g. svg
references) to be broken.

For this reason, we should now start recommending that people just
deploy to root context (/) and not set the base[href] when using
the html5 mode (push/pop history state).

If it's impossible to deploy to the root context then either all
urls in the app must be absolute or base[href] must be set with the
caveat that anchor urls in such app won't work.

Closes #2762
2013-06-24 22:32:55 -07:00
Chirayu Krishnappa
0960cd0613 test($compile): fix IE specific test. 2013-06-24 21:02:01 -07:00
Chirayu Krishnappa
cefdaf131d fix($parse): move global getter out of parse.js 2013-06-24 20:46:32 -07:00
Chirayu Krishnappa
38deedd6e3 fix($compile): reject multi-expression interpolations for src attribute
BREAKING CHANGE: Concatenating expressions makes it hard to reason about
    whether some combination of concatenated values are unsafe to use
    and could easily lead to XSS.  By requiring that a single expression
    be used for *[src/ng-src] such as iframe[src], object[src], etc.
    (but not img[src/ng-src] since that value is sanitized), we ensure that the value
    that's used is assigned or constructed by some JS code somewhere
    that is more testable or make it obvious that you bound the value to
    some user controlled value.  This helps reduce the load when
    auditing for XSS issues.

    To migrate your code, follow the example below:

        Before:
            JS:
                scope.baseUrl = 'page';
                scope.a = 1;
                scope.b = 2;
            HTML:
                <!-- Are a and b properly escaped here? Is baseUrl
                     controlled by user? -->
                <iframe src="{{baseUrl}}?a={{a}&b={{b}}">

        After:
            JS:
                var baseUrl = "page";
                scope.getIframeSrc = function() {
                  // There are obviously better ways to do this.  The
                  // key point is that one will think about this and do
                  // it the right way.
                  var qs = ["a", "b"].map(function(value, name) {
                      return encodeURIComponent(name) + "=" +
                             encodeURIComponent(value);
                    }).join("&");
                  // baseUrl isn't on scope so it isn't bound to a user
                  // controlled value.
                  return baseUrl + "?" + qs;
                }
            HTML: <iframe src="{{getIframeSrc()}}">
2013-06-24 14:17:18 -07:00
Chirayu Krishnappa
39841f2ec9 fix($compile): disallow interpolations for DOM event handlers
BREAKING CHANGE: Interpolations inside DOM event handlers are
    disallowed.  DOM event handlers execute arbitrary Javascript code.
    Using an interpolation for such handlers means that the interpolated
    value is a JS string that is evaluated.  Storing or generating such
    strings is error prone and likely leads to an XSS if you're not
    super careful.  On the other hand, ng-click and such event handlers
    evaluate Angular expressions that are a lot safer (e.g. No direct
    access to global objects - only scope), cleaner and harder to
    exploit.

    To migrate the code follow the example below:

    Before:

        JS:   scope.foo = 'alert(1)';
        HTML: <div onclick="{{foo}}">

    After:

        JS:   scope.foo = function() { alert(1); }
        HTML: <div ng-click="foo()">
2013-06-21 17:37:44 -07:00
Chirayu Krishnappa
1adf29af13 fix($compile): sanitize values bound to img[src]
Ref: 9532234bf1

BREAKING CHANGE: img[src] URLs are now sanitized using the same whitelist
    as a[href] URLs.  The most obvious impact is if you were using data:
    URIs.  data: URIs will be whitelisted for img[src] in a future
    commit.
2013-06-21 17:26:42 -07:00
Chirayu Krishnappa
99e85fc9b5 fix(docs): set ng-app for editing with plunker
Closes #3011
2013-06-21 12:28:34 -07:00
Pete Bacon Darwin
097947fd3b refactor(angular.bootstrap): rename internal function 2013-06-20 15:22:35 +01:00
NimaVaziri
3621896e9d docs(cookbook/helloworld): display "World" if no name is entered 2013-06-20 14:39:16 +01:00
Pete Bacon Darwin
8264d08085 fix(Angular.js): don't crash on invalid query parameters 2013-06-20 14:13:16 +01:00
Jens Rantil
a7908134cb docs(ngRepeat): fix typo 2013-06-20 11:07:13 +01:00
Caio Cunha
53359d549e fix($http): ensure case-insens. header overriding
If user send content-type header, both content-type and default
Content-Type headers were sent. Now default header overriding is
case-insensitive.
2013-06-19 21:30:59 +01:00
Michał Gołębiowski
f1b94b4b59 feat(jqLite): switch bind/unbind to more recent jQuery on/off
jQuery switched to a completely new event binding implementation as of
1.7.0, centering around on/off methods instead of previous bind/unbind.
This patch makes jqLite match this implementation while still supporting
previous bind/unbind methods.
2013-06-19 20:53:24 +01:00
sarkasm
0bfa29377d docs(directive): fix typo 2013-06-19 11:50:47 +01:00
gdi2290
db8d8f9a43 docs(tutorial): add missing 'node' command and <code> tags 2013-06-18 22:05:28 +01:00
John Bohn
8b81cf202b docs(tutorial/step_07): add commas make tutorial read more clearly 2013-06-18 21:56:53 +01:00
Ore Landau
6295a0d9bd docs(loader): fix typo and minor semantic error 2013-06-18 21:21:20 +01:00
Matias Niemelä
bf7ec4bbb1 chore(ngdocs): change minimum search length requirement 2013-06-18 09:40:13 -04:00
Matias Niemelä
f6be59c1b9 chore(ngdocs): provide test code for lunr search in docs 2013-06-18 09:37:29 -04:00
Matias Niemelä
46dfb92afd feat(ngdocs): provide support for user to jump between different versions of the angularjs documentation 2013-06-17 22:17:44 -07:00
Matias Niemelä
ef22968810 feat(ngdocs): support popover, foldouts and foldover annotations 2013-06-17 22:00:54 -07:00
Matias Niemelä
07ef1667db fix(ngMock): ensure mocked window still provides window.location functionality 2013-06-17 21:23:22 -07:00
Matias Niemelä
cec4ce28b9 chore(ngdocs): allow user to press escape key to close docs search 2013-06-17 21:23:22 -07:00
Matias Niemelä
0cac8729fb fix(jqLite): allow override of jqLite.triggerHandler event object 2013-06-17 21:23:22 -07:00
Matias Niemelä
6822709191 chore(ngdocs): update lunr to 0.4.0 2013-06-17 21:23:22 -07:00
Ken Sheedlo
003861d2fd chore(minErr): replace ngError with minErr 2013-06-17 13:29:30 -07:00
Igor Minar
908071afbf feat(Grunt): add source maps to all min files
Generate source map files when build step is ran and adds source map
headers to all min files.

Source map url must be appended to the min file otherwise the line
offsets will be off.

Inspired by Ryan Seddon (PR #2858)

Closes #1714
2013-06-14 21:51:25 -07:00
Ore Landau
cd3dd13425 docs(guide/di): fix headings hierarchy 2013-06-13 22:50:57 +01:00
Misha Moroshko
45ee8844f9 docs(select): fix typos in ngOptions 2013-06-13 22:47:47 +01:00
Ore Landau
9e2fd89021 docs($q): fix a few issues 2013-06-13 22:42:10 +01:00
Jad Naous
a2d4b5c5d8 docs(guide/e2e-testing): fix verb tense 2013-06-13 22:37:19 +01:00
Julien Bouquillon
14285568ca style(ngRepeat): fix typos 2013-06-13 21:17:52 +01:00
Ore Landau
5ec188f697 docs(tutorial/step_05): apply more useful link to services 2013-06-13 21:14:06 +01:00
Dean Sofer
83f445336f docs(FormController): add methods for FormController 2013-06-12 21:46:31 +01:00
Dean Peterson
0cb87f91ae docs(ngModelController): improve $parsers/$formatters with example 2013-06-12 21:17:42 +01:00
Ore Landau
6ca5272f94 docs(ngClass): fix minor typo. 2013-06-12 20:47:32 +01:00
Pete Bacon Darwin
a4c3b06807 docs(guide/bootstrap): clarify manual bootstrapping 2013-06-12 20:40:07 +01:00
Pete Bacon Darwin
86f3e41dfe chore(docs/writer): fix Windows path incompatibilities
NodeJS on Windows uses back slashes for path separators. This
difference can be mitigated by use of the nodeJS path library.
In particular the `sep` property and the `dirname()`, `normalize()`
and `join()` methods of this library.  All path based arguments on
exported functions need to be normalized and `join` and `sep` must
be used instead of string manipulation to work with paths.
2013-06-12 20:02:45 +01:00
Pete Bacon Darwin
c9c3f718e2 docs(ngRoute): clarify when gets updated 2013-06-11 22:15:54 +01:00
Pete Bacon Darwin
b6ff8d751f docs(ngSubmit): clarify that there must be no action attribute 2013-06-11 21:29:58 +01:00
Misko Hevery
4953b49761 fix(ngRepeat): support growing over multi-element groups 2013-06-11 13:14:34 -07:00
Misko Hevery
b28f96949a fix($compile): support multi-element group over text nodes 2013-06-11 13:14:34 -07:00
Matias Niemelä
6b12432729 chore(ngdocs): add angular-route.js to karma docs suite 2013-06-10 18:55:26 -07:00
Matias Niemelä
ba3ca0be41 fix(angularFiles): ensure only karma-docs.js tests the component-spec files 2013-06-10 18:16:57 -04:00
Igor Minar
6c66315494 chore(docs): fix memory leak in example embed code
we need to sever the link between the main root scope and the example
root scope - this is only needed because we are embedding one app
in the other.
2013-06-10 13:14:26 -07:00