Compare commits

...

1824 Commits

Author SHA1 Message Date
Igor Minar e16c9362e7 chore(release): cut 1.2.0rc1 spooky-giraffe 2013-08-13 11:50:32 -07:00
Igor Minar ef3569e772 chore(grunt): support RCs in version numbers 2013-08-13 10:59:21 -07:00
Igor Minar f310bcc4d7 docs(CHANGELOG): release notes for 1.2.0-rc1 spooky-giraffe 2013-08-13 10:49:02 -07:00
Igor Minar 0dd062231a chore(mocks): remove obsolte createMockWindow api
we never released this api, so it's safe to remove
2013-08-13 10:48:54 -07:00
Igor Minar e3e57fb9cd chore(changelog.js): pickup breaking changes f/ chore/refactor commits 2013-08-13 10:00:14 -07:00
Ken Sheedlo 1429a71474 fix(minerr): escape double quotes in error displays
Closes #3553
2013-08-12 16:16:39 -07:00
Igor Minar d69cd7d9ca test($location): fix broken tests
sorry, my bad!
2013-08-12 14:43:24 -07:00
Igor Minar ca92b6528a docs(minErr): add location/ipthprfx 2013-08-12 14:09:09 -07:00
Igor Minar 2c64f3dc17 docs(minErr): add location/isrcharg docs 2013-08-12 14:09:09 -07:00
Igor Minar 72dc48ea4d docs(minErr): add location/ihshprfx 2013-08-12 14:09:08 -07:00
Igor Minar 544d2616b4 chore($location): drop bugus error
we can never get to this state, so dropping the error
2013-08-12 14:09:08 -07:00
Igor Minar d4d34aba6e fix($location): don't initialize hash url unnecessarily
After a recent refactoring using $location in the default hashbang mode would result
in hash url being initialized unnecessarily in cases when the base url didn't end
with a slash.

for example http://localhost:8000/temp.html would get rewritten as
http://location:8000/temp.html#/temp.html by error.
2013-08-12 14:09:08 -07:00
joshrtay 04cebcc133 feat($route): express style route matching
Added new route matching capabilities:
  - optional param
Changed route matching syntax:
 - named wildcard

BREAKING CHANGE: the syntax for named wildcard parameters in routes
    has changed from *wildcard to :wildcard*

    To migrate the code, follow the example below.  Here, *highlight becomes
    :highlight*:

    Before:

    $routeProvider.when('/Book1/:book/Chapter/:chapter/*highlight/edit',
              {controller: noop, templateUrl: 'Chapter.html'});

    After:

    $routeProvider.when('/Book1/:book/Chapter/:chapter/:highlight*/edit',
            {controller: noop, templateUrl: 'Chapter.html'});
2013-08-12 11:04:37 -07:00
Chirayu Krishnappa c173ca4128 fix($compile): correct controller instantiation for async directives
This fixes regression introduced by #3514 (5c560117) - this commit is being
reverted here and a better fix is included.

The regression caused the controller to be instantiated before the isolate scope
was initialized.

Closes #3493
Closes #3482
Closes #3537
Closes #3540
2013-08-12 10:36:25 -07:00
Matias Niemelä 2430347ece fix(ngAnimate): make sure that the class value passed into addClass/removeClass is the base class string value 2013-08-09 14:39:58 -07:00
Matias Niemelä f61ff69519 chore(ngAnimate): fix incomplete animation test 2013-08-09 14:39:58 -07:00
Matias Niemelä 87405e25ae fix(ngView): ensure ngView is terminal and uses its own manual transclusion system 2013-08-09 14:39:58 -07:00
Matias Niemelä 1b5bee4fa1 fix(ngInclude): ensure ngInclude is terminal and uses its own manual transclusion system 2013-08-09 14:39:57 -07:00
Ken Sheedlo 45dc9ee7b4 style(minerr): prefer component name as namespace
Closes #3527
2013-08-09 14:12:04 -07:00
Brian Ford f078762d48 chore($q): rename promise.always to promise.finally
BREAKING CHANGE: the `always` method has been renamed to `finally`.

The reason for this change is to align `$q` with the Q promises library,
despite the fact that this makes it a bit more difficult to
use with non-ES5 browsers, like IE8.

`finally` also goes well together with `catch` api that was added to
$q recently and is part of the DOM promises standard.

To migrate the code follow the example below:

Before:

$http.get('/foo').always(doSomething);

After:

$http.get('/foo').finally(doSomething);

or for IE8 compatible code:

$http.get('/foo')['finally'](doSomething);
2013-08-09 14:08:57 -07:00
Jeff Cross 3ee744cc63 fix(re-bootstrap): Throw an error when bootstrapping a bootstrapped element.
Nothing would prevent a user from accidentally calling angular.bootstrap on an element that had already been bootstrapped. If this was done, odd behavior could manifest in an application, causing different scopes to update the same DOM, and causing debugger confusion.

This fix adds a check inside of angular.bootstrap to check if the passed-in element already has an injector, and if so, will throw an error.
2013-08-09 13:14:12 -07:00
Brian Ford 94ec84e7b9 chore(ngMobile): rename module ngTouch and file to angular-touch.js
BREAKING CHANGE: since all the code in the ngMobile module is touch related,
we are renaming the module to ngTouch.

To migrate, please replace all references to "ngMobile" with "ngTouch" and
"angular-mobile.js" to "angular-touch.js".

Closes #3526
2013-08-09 11:54:35 -07:00
OpherV 0d17838a08 docs($compile): update directive type signature
To avoid "Argument type Array is not assignable to parameter type function" validation error  When using the minifcation-safe array style

(eg .directive('myDirective', ['$http','$timeout','$compile', function($http,$timeout $compile).... )

Closes #3392
2013-08-09 10:32:27 -07:00
Niall Smart 890e939fcc docs(ngModel): validators should return undefined for invalid values.
Closes #3525
2013-08-09 10:21:32 -07:00
Jeff Cross 0b114fd3e1 fix(docs-bootstrap): Removed injector from bootstrapped docs samples
This is necessary to make e2e tests pass for implementing #3411. At present, the docs are violating the rule being enforced by double-bootstrap prevention.
2013-08-09 10:19:41 -07:00
Santi Albo 61cb4085d4 docs(httpBackend): update documentation for expect methods
`expect` methods can receive an Object as the data parameter, which was
undocumented.
2013-08-09 10:08:36 -07:00
Igor Minar 0c399bc546 chore($compile): remove bogus scope/controller check
We already have the same test in $controller which is called just a few lines above

Closes #3517
2013-08-09 09:54:17 -07:00
bolasblack a207665dad feat($q): add shorthand for defining promise error handlers
Now we can instead this

    promise.then(null, errorHandler)

with this

    promise.catch(errorhandler)

Closes #2048
Closes #3476
2013-08-09 09:02:58 -07:00
Igor Minar b3087421f2 docs(jqLite): update the minErr codes for on() and off() 2013-08-09 00:39:31 -07:00
Igor Minar 3824e40011 fix(jqLite): properly detect unsupported calls for on()/off() 2013-08-09 00:12:19 -07:00
Matias Niemelä 953fa4cd16 chore(grunt): fix up the help text for the new test commands
Closes #3421
2013-08-08 23:53:09 -07:00
Matias Niemelä 05b41eedce fix(grunt): ensure all dependent tasks are called for all test task
Close #3421
2013-08-08 23:50:28 -07:00
Andy Hitchman f80730f497 fix(angular.copy): change angular.copy to correcly clone RegExp
angular.copy previously copied RegExp as an empty object. Change detects
RegExp instance and clones into new RegExp. This change is based on a previous
fix to allow Date to be copied.

Closes #3473
Closes #3474
2013-08-08 23:29:59 -07:00
Igor Minar 43997c1540 docs(ngModel): clarify docs for NgModelController#
Closes #3498
2013-08-08 23:08:40 -07:00
Ken Sheedlo af2cda3687 fix(docs/error): make minerr ids searchable
Closes #3513
2013-08-08 22:42:25 -07:00
Ken Sheedlo 4f5dfbc362 fix(jqLite): throw when jqLite#off called with 4 args
Closes #3501
2013-08-08 22:40:04 -07:00
jankuca 5c56011742 fix($compile): always instantiate controllers before pre-link fns run
Controllers should be always instantiated after compile fn runs, but before
pre-link fn runs. This way, controllers are available to pre-link fns that
request them.

Previously this was broken for async directives (directives with templateUrl).

Closes #3493
Closes #3482
Closes #3514
2013-08-08 21:53:44 -07:00
Misko Hevery 4175377aaf docs(compile/tplrt): description for compile/tplrt error
Closes #3459
2013-08-08 18:58:08 -07:00
Misko Hevery dbd703a9fb docs(compile/selmulti): description for compile/selmulti error
Closes #3459
2013-08-08 17:16:46 -07:00
Misko Hevery fa3985764c docs(compile/nodomevents): description for compile/nodomevents error
Closes #3459
2013-08-08 14:45:04 -07:00
Misko Hevery 78a445fa37 docs(compile/notassign): description for compile/notassign error
Closes #3459
2013-08-08 14:33:16 -07:00
Misko Hevery 4e76d0469e docs(compile/multidir): description for compile/multidir error
Closes #3459
2013-08-08 14:14:33 -07:00
Igor Minar 3fb80b4ea1 docs(minErr): add controller/noscp docs 2013-08-08 12:13:34 -07:00
Igor Minar 74d50f7c16 docs(minErr): add rootScope/inprog docs 2013-08-08 12:04:34 -07:00
Igor Minar 465a2937cc docs(minErr): improve compiler/iscp 2013-08-08 11:26:56 -07:00
Igor Minar 69058bf2c4 docs(minErr): improve sce/icontext 2013-08-08 11:24:34 -07:00
Igor Minar c7953ffb7f docs(minErr): improve sce/iequirks doc 2013-08-08 11:23:17 -07:00
Ken Sheedlo 40d351712e docs(minerr): add description for ngResource:badargs
Closes #3510
2013-08-08 11:19:25 -07:00
Brian Ford 3cde777514 docs(minErr): add minErr description for jqLite:nosel
Closes #3426
2013-08-08 11:11:17 -07:00
Ken Sheedlo def7e961b4 docs(minerr): add description for ngResource:badcfg
Closes #3509
2013-08-08 11:08:03 -07:00
Igor Minar e27fb4ddd6 docs(minErr): rename compile/utrat to compile/uterdir 2013-08-08 11:02:30 -07:00
Ken Sheedlo caa71c2772 docs(minerr): add description for $compile:utrat
Closes #3507
2013-08-08 10:56:55 -07:00
Igor Minar 934e569cca docs(minErr): improve sce/isecurl doc 2013-08-08 10:32:55 -07:00
Igor Minar 0bf0570505 docs(minErr): rename sce/isecrurl to sce/insecurl 2013-08-08 10:22:32 -07:00
Igor Minar 3ab579a2a6 docs(minErr): improve sce/itype.ngdoc 2013-08-08 10:21:26 -07:00
Igor Minar a53e466b80 docs(ngModel): add link to NgModelController 2013-08-08 10:12:13 -07:00
Brian Ford 5d3744ad9b docs(minErr): add minErr description for $compile:ctreq
Closes #3423
2013-08-08 10:11:56 -07:00
Ken Sheedlo e4b6a1eaa4 docs(minerr): fill in error message descriptions
Errors I've documented so far:
- `$injector:cdep`
- `$injector:itkn`
- `$injector:modulerr`
- `$injector:nomod`
- `$injector:pget`
- `$injector:unpr`
- `ng:areq`
- `ng:cpi`
- `ng:cpws`
- `ngModel:noass`

Closes #3430
2013-08-07 21:36:59 -07:00
Eric Hagman 306a613440 fix(jqLite): return array from multi select in val() 2013-08-07 21:33:37 -07:00
Chirayu Krishnappa 4be7612079 test(matchers): support 'not' text in toBeHidden matcher 2013-08-07 16:35:37 -07:00
Jamund Ferguson 66007a4150 docs(ngClass): updated the example with string, map and array syntax
Closes #3084
2013-08-07 15:36:02 -07:00
Ken Sheedlo 7f14cdeeb5 docs(minerr): add description for $rootScope:infdig 2013-08-07 15:26:27 -07:00
jankuca ca09a0db2f chore(bower): add a .bowerrc file 2013-08-07 14:11:23 -07:00
Matthew Windwer 8ea802a1d2 feat(ngForm): Supports expression in form names
<form name="ctrl.form"> form controller will accessible
as $scope.ctrl.form instead of $scope['ctrl.form']

BREAKING CHANGE:
If you have form names that will evaluate as an expression:

<form name="ctrl.form">

And if you are accessing the form from your controller:

  Before:

  function($scope) {
    $scope['ctrl.form'] // form controller instance
  }

  After:

  function($scope) {
    $scope.ctrl.form // form controller instance
  }

This makes it possible to access a form from a controller
using the new "controller as" syntax. Supporting the previous
behavior offers no benefit.
2013-08-07 13:50:18 -07:00
Chirayu Krishnappa be621934ed fix(compile): fix directive as identifier 2013-08-07 13:02:46 -07:00
David Mosher 6d7ee1ad3b docs(ngRoute): make config block for the routeProvider example explicit 2013-08-07 21:59:01 +02:00
Igor Minar d1cdd4d026 chore(dump): fix our karma.dump bridge
previously it didn't work for dumping multiple objects
2013-08-07 11:21:34 -07:00
neilmcgibbon af731354b0 fix(input): fix the email regex to accept TLDs up to 6 characters long
The input field email regex does't not match long domain extensions. This commit extends the email regexp to take a 6 character TLD.

Example 6-character TLDs include .museum and .travel - (e.g. allabout.travel).
2013-08-07 14:02:44 -04:00
Brian Ford a02aaf1709 docs(minErr): add minErr description for $compile:tpload
Closes #3427
2013-08-07 10:45:11 -07:00
Pawel Kozlowski ab59cc6c44 fix(jqLite): forgive unregistration of a non-registered handler 2013-08-07 18:52:47 +02:00
naomiblack ad2b8c5bd4 docs(error): updated description for ngPattern/noregexp.ngdoc 2013-08-07 09:50:38 -07:00
naomiblack e4530d11fb docs(error): added description for ngOptions/iexp.ngdoc
Closes #3431
2013-08-07 09:47:13 -07:00
naomiblack 88037ad688 docs(error): added description for ngSanitize/badparse.ngdoc
Closes #3438
2013-08-07 09:43:14 -07:00
Igor Minar e38bf59aab docs(minErr): improve $parse/isecfn 2013-08-07 09:32:23 -07:00
James deBoer e21f252aa7 docs(minerr): Adds a description for parser.lexerr
Closes #3433
2013-08-07 09:30:04 -07:00
James deBoer 03475194d8 docs(minerr): Adds a description for parser.syntax
Closes #3434
2013-08-07 09:28:24 -07:00
James deBoer 68d79d560e docs(minerr): Adds a description for parser.ueoe
Closes #3435
2013-08-07 09:26:04 -07:00
James deBoer 3b89e4eef1 docs(minerr): Adds a description for ngRepeat.dupes
Closes #3439
2013-08-07 09:22:21 -07:00
James deBoer fe187674b5 docs(minerr): Adds a description for ngRepeat.iexp
Closes #3440
2013-08-07 09:11:15 -07:00
James deBoer 446ee4ea19 docs(minerr): Adds a description for ngRepeat.iidexp
Closes #3441
2013-08-07 09:05:12 -07:00
James deBoer 63b6c5b3f2 docs(mirErr): add a description for $parse.isecfld and isecfn 2013-08-07 08:49:56 -07:00
Ken Chen 08daa7797b feat(ngMock/$httpBackend): support a matching function for data param
Add support for passing function as validating data:
 - To avoid hacking test method of RegExp
 - Optionally overwrite `toString` method of fn to show validation tips
 - change docs: param description for `when`, `whenPost`, `whenPut`,
   `expect`, `expectPost`, `expectPut`, `expectPATCH`

Closes: #2981
2013-08-06 16:54:50 +01:00
Michael Stewart ac5105b198 docs(compile): fix minor spelling mistake
Closes: #3468
2013-08-06 16:30:55 +01:00
Ken Sheedlo 285f6b4ec6 fix(tutorial): show tutorial pages in search nav 2013-08-05 16:41:49 -07:00
Mark Campbell fda5eb7ebc docs(guide/controller): fix wording in list of 'Do not use'
Wording has been changed in two of the examples to read naturally.
For example:

From: 'Do not use controllers for to run stateless or stateful code
shared across controllers'

To: 'Do not use controllers for sharing stateless or stateful code
across controllers'

Closes #3454
2013-08-03 22:05:33 +01:00
Matias Niemelä f2dfa8916f feat($compile): support compile animation hooks classes 2013-08-03 00:46:18 -07:00
Matias Niemelä d45ac7707e chore(ngdocs): provide detailed documentation for the $animate service timeline 2013-08-03 00:46:18 -07:00
Matias Niemelä 9f3935baff chore(ngdocs): provide docs for the core $animator service 2013-08-03 00:46:18 -07:00
Misko Hevery 2e72239133 fix(animate): cleanup global leaked vars. 2013-08-03 00:46:17 -07:00
Matias Niemelä 6e8bd786ba fix(ngAnimate): remove compound JS selector animations 2013-08-03 00:46:17 -07:00
Matias Niemelä 4ed5fc90b9 chore(ngdocs): make sure the fold feature doesn't show up during page load 2013-08-02 23:56:04 -07:00
Matias Niemelä 246c1439b5 fix(ngShowHide): change the .ng-hide CSS class to use an !important flag 2013-08-02 23:55:53 -07:00
Matias Niemelä 85f0d4af97 chore(ngMock): remove unused $animate delegation methods 2013-08-02 23:52:48 -07:00
Matias Niemelä 85d705ab69 chore(ngMock): rename $animate.process to $animate.flushNext() 2013-08-02 23:52:37 -07:00
Misko Hevery 52a7c351c9 docs(compile/iscp): description for compile/iscp error 2013-08-02 23:52:21 -07:00
Étienne Barrié 3079a6f4e0 fix(ngMock): keep withCredentials on passThrough
When using passThrough() and specifying withCredentials on the $http
call, the option is now passed to the underlying $httpBackend.
2013-08-01 16:07:33 -07:00
Ken Sheedlo 3c0c7165e2 fix(docs): handle the empty string in errorDisplay 2013-08-01 15:32:46 -07:00
Misko Hevery 705c9d95bc fix(location): fix parameter handling on search() 2013-07-31 16:55:06 -07:00
James Davies 61906d3517 fix($parse): unwrap promise when setting a field
This fixes an inconsistency where you can't call the setter function
when the expression resolves to a top level field name on a promise.

Setting a field on an unresolved promise will throw an exception.  (This
shouldn't really happen in your template/js code and points to a
programming error.)

Closes #1827
2013-07-31 16:22:24 -07:00
Jan Laußmann 0bbd20f255 fix(mobile-ng-click): prevent unwanted opening of the soft keyboard
Ghost clicks are busted but the corresponding form elements are still focused. This means that for example on smartphones the soft keyboard will be opened. This pull request prevents the unwanted opening of the soft keyboard.
2013-07-31 16:08:00 -07:00
Andreas Marek 3fdbe81a33 feat(scenario): expose jQuery for usage outside of angular scenario
The global jQuery reference is removed by angular scenario and only a local scoped reference is kept. To make jQuery available for other code, a new reference angular.scenario.jQuery is added.
2013-07-31 15:50:12 -07:00
Igor Minar ca3e0c8ce5 chore(travis): print grunt exit code for debugging 2013-07-31 15:31:53 -07:00
Igor Minar 14b1297b51 style($sce): remove unreachable return statement 2013-07-31 15:22:18 -07:00
Andy Joslin bdd4e982b7 fix(jqLite): support space-seperated events in off
Closes #3256
2013-07-31 14:23:35 -07:00
Chirayu Krishnappa f274c0a66b fix(mock.$log): keep in sync with $log
Closes #2343
2013-07-31 13:38:24 -07:00
Pete Bacon Darwin 664526d69c fix($q): call reject() even if $exceptionHandler rethrows
Normally $exceptionHandler doesn't throw an exception.  It is normally
used just for logging and so on.  But if an application developer
implemented a version that did throw an exception then $q would never
have called reject() when converting an exception thrown inside a `then`
handler into a rejected promise.
2013-07-31 21:17:38 +01:00
Pete Bacon Darwin a644ca7b4e fix(resource): check whether response matches action.isArray
When using $resource you must setup your actions carefully based on what the server returns.
If the server responds to a request with an array then you must configure the action with
`isArray:true` and vice versa.  The built-in `get` action defaults to `isArray:false` and the
`query` action defaults to `isArray:true`, which is must be changed if the server does not do this.
Before the error message was an exception inside angular.copy, which didn't explain what the
real problem was. Rather than changing the way that angular.copy works, this change ensures that
a better error message is provided to the programmer if they do not set up their resource actions
correctly.

Closes #2255, #1044
2013-07-31 21:17:37 +01:00
Brenton 24a4450f2b docs(header): replace logo.png with logo.svg
The current logo looks awful on high-density displays.  SVG is a
better choice because it can scale to any resolution without
increasing file size.

Amending #2775 to add support for IE 8 by falling back to existing PNG
with img.onerror

Using relative URLs as directed by @btford and @petebacondarwin.

(commit by Brenton Simpson - @appsforartists)

Closes #2874
2013-07-31 11:48:13 -07:00
Daniel Herman fad626f304 fix(isArrayLike) Correctly detect arrayLike items
Change the implementation of isArrayLike to use one heavily based on the
implementation in jQuery in order to correctly detect array-like
objects, that way functionality like ngRepeat works as expected.
2013-07-31 11:08:56 -07:00
Lucas Galfasó 000012f319 feat(directive): support as instance syntax
Support controller: 'MyController as my' syntax for directives which publishes
the controller instance to the directive scope.

Support controllerAs syntax to define an alias to the controller within the
directive scope.
2013-07-31 10:31:42 -07:00
Lucas Galfasó b3777f275c feat(directive): support as instance syntax
Support controller: 'MyController as my' syntax for directives which publishes
the controller instance to the directive scope.

Support controllerAs syntax to define an alias to the controller within the
directive scope.
2013-07-31 10:30:58 -07:00
Ken Sheedlo aa5a16224b chore(bower): write grunt task for running bower 2013-07-30 17:31:35 -07:00
Igor Minar a7ae292e39 docs(error): improve the cacheFactory/iid.ngdoc 2013-07-30 17:29:35 -07:00
Ken Sheedlo 58c0415a53 chore(bower): update to bower 1.0.3 2013-07-30 14:12:26 -07:00
Matias Niemelä e1fe2ac269 chore(ngdocs): all animation-supported directives working with docs examples and jsFiddle/Plunkr pages 2013-07-29 21:22:05 -07:00
Matias Niemelä 33d45d8faf fix(ngClass): ensure ngClass doesn't fire addClass or removeClass with an empty string
If ngClass fires off an add- or removeClass whilst the opposite animation is going on then
the animation will be skipped. The default behavior of ngClass was executing remoteClass
with an empty string while addClass had just fired. This commit fixes that bug.
2013-07-29 21:22:05 -07:00
Matias Niemelä 419ed040b6 chore(ngdocs): fixed jsFiddle/Plunkr examples to include ngAnimate and use a default App the module is not set 2013-07-29 21:22:05 -07:00
Matias Niemelä 8d6bd51094 fix(ngdocs): make jsFiddle and Plunkr links work with external AngularJS modules 2013-07-29 21:22:05 -07:00
Ken Sheedlo 576269b1b7 fix(bower): update bower usage and resources
Changes:
- Fix our old code to use bower_components/ as the install dir
- Fix the Bootstrap asset to use github.com/twbs/bootstrap (it moved)
- Fail the build on Bower failure. Bower should not fail silently.
2013-07-29 17:26:01 -07:00
Ken Sheedlo e1a8b42400 chore(bower): upgrade bower to 1.0.0
We explicitly set the Bower install directory to components/ for
compatibility with our existing code base. Recent Bower prefers
bower_components/.
2013-07-29 16:16:36 -07:00
Ken Sheedlo d2901bcf7d chore(bower): update to latest ng-closure-runner
This version does correct URL encoding of string parameters in the
production minErr asset code.
2013-07-29 14:43:48 -07:00
Brian Fitzpatrick f6663b4314 test($compile): fix spelling error in assertion (ngAttr*)
The string 'test2' should be 'test3' as 'test2' has already been
tested with the previous assertion.
2013-07-28 20:30:30 +01:00
Carl Danley 258e986284 docs(*): fixed typos and ngdoc parameter names 2013-07-27 20:53:41 +02:00
Pete Bacon Darwin 1bc99eca08 docs(interpolate): remove example e2e test that cannot run
We can't create modules in docs e2e tests as the injector has already
been created.
2013-07-27 18:24:27 +01:00
Ken Sheedlo 3570005067 fix(docs): fix margin around nav-list items
Closes #3363
2013-07-27 17:54:56 +01:00
Emmanuel 36ab132b82 docs($interpolate): add example for the provider 2013-07-27 17:21:04 +01:00
Pete Bacon Darwin 3c6821b9ad docs(animate): add param name 2013-07-27 17:17:50 +01:00
Roland 3f943e7246 docs(tutorial): mention the controller along the scope 2013-07-27 17:13:53 +01:00
Pete Bacon Darwin bc8c5257e8 fix(animate): move forEach so it can be accessed as needed 2013-07-27 16:53:11 +01:00
Roland 9fcb5c0891 docs(tutorial): add formatting
the string literal {{query}} was missing as it was not enclosed into ``
2013-07-27 16:07:38 +01:00
Roland f5b8092a1c docs(tutorial): add that the test also creates a controller 2013-07-27 15:52:20 +01:00
Matias Niemelä b322cbf335 chore(.gitignore): ignore npm-debug.log file 2013-07-26 23:49:54 -07:00
Matias Niemelä 658bcf96b9 chore(ngdocs): fix docs search to properly hide the X button when collapsed 2013-07-26 23:49:54 -07:00
Matias Niemelä e31104fa6c fix($animate): make animation onComplete callbacks async 2013-07-26 23:49:54 -07:00
Matias Niemelä 15389b0e37 fix(ngAnimate): $timeout integration and cancel callbacks added 2013-07-26 23:49:54 -07:00
Matias Niemelä 7d69d52acf chore(ngView): $animate refactoring + transclusion & tests
BREAKING CHANGE: previously ngView only updated its content, after this change
ngView will recreate itself every time a new content is included. This ensures
that a single rootElement for all the included contents always exists, which makes
definition of css styles for animations much easier.
2013-07-26 23:49:54 -07:00
Matias Niemelä aa2133ad81 fix(ngInclude): $animate refactoring + use transclusion
BREAKING CHANGE: previously ngInclude only updated its content, after this change
ngInclude will recreate itself every time a new content is included. This ensures
that a single rootElement for all the included contents always exists, which makes
definition of css styles for animations much easier.
2013-07-26 23:49:54 -07:00
Matias Niemelä 8ed0d5b6aa chore($animate): replace show/hide with addClass/removeClass 2013-07-26 23:49:54 -07:00
Matias Niemelä 81923f1e41 feat(ngAnimate): complete rewrite of animations
- ngAnimate directive is gone and was replaced with class based animations/transitions
- support for triggering animations on css class additions and removals
- done callback was added to all animation apis
- $animation and $animator where merged into a single $animate service with api:
  - $animate.enter(element, parent, after, done);
  - $animate.leave(element, done);
  - $animate.move(element, parent, after, done);
  - $animate.addClass(element, className, done);
  - $animate.removeClass(element, className, done);

BREAKING CHANGE: too many things changed, we'll write up a separate doc with migration instructions
2013-07-26 23:49:54 -07:00
Ken Sheedlo 11521a4cde fix($compile): don't use new with minErr
Someone wrote `throw new $compileMinErr(...)` when it should have been
`throw $compileMinErr(...)`. This caused a build warning.
2013-07-26 15:58:40 -07:00
Matias Niemelä fbad068aeb fix(grunt): change css wrapping to prepend styles to the top of the head tag
angular.css is used by the utils.js CSS wrap operation, but ng-hide or
any other CSS styles present in angular.css cannot be overridden unless
the styles appear before the stylesheet is in place. This fix allows
for this to work
2013-07-26 10:30:09 -07:00
Wesley Cho 6031f1db51 chore($compile): removed unused variable 2013-07-26 10:14:45 -07:00
Matias Niemelä 462ed033d5 feat(ngMock): $timeout.flushNext can expect specific timeout delays
the $timeout mock's flush method allows flushing queued up requests
but doesn't allow to for checking with what delay a task was queued
up. flushNext flushes the next queued up task and can asserts the
scheduled delay.
2013-07-26 08:57:25 -07:00
Matias Niemelä b7fdabc4bf feat(ngMock): support delay limit for $timeout.flush 2013-07-26 08:56:41 -07:00
Matias Niemelä 258cae83dc chore(ngdocs): replace showdown.js with marked.js 2013-07-26 08:51:38 -07:00
Braden Shepherdson ab18914298 feat(ngMobile): emit 'swipeleft' and 'swiperight' events
Similar to ngMobile clicks, these events were not capturable by other
directives. Now they emit 'swipeleft' and 'swiperight' events that can
be follow with element.on('swipeleft', ...).
2013-07-25 16:36:11 -07:00
Igor Minar f9ea69f656 fix($compile): don't check attr.specified on non-ie7
the specified attribute is depricated and creates warnings in Firefox

Closes #3231
Closes #2160
2013-07-25 15:49:57 -07:00
Ken Sheedlo 09fa0656b4 feat(minErr): Include version number in prod minErr urls 2013-07-25 15:45:35 -07:00
Roland 27041e63a6 docs(guide): remove superfluous }); 2013-07-25 15:05:27 -07:00
Chirayu Krishnappa dae694739b feat(ngBindHtml, sce): combine ng-bind-html and ng-bind-html-unsafe
Changes:
- remove ng-bind-html-unsafe
- ng-bind-html is now in core
- ng-bind-html is secure
  - supports SCE - so you can bind to an arbitrary trusted string
  - automatic sanitization if $sanitize is available

BREAKING CHANGE:
  ng-html-bind-unsafe has been removed and replaced by ng-html-bind
  (which has been removed from ngSanitize.)  ng-bind-html provides
  ng-html-bind-unsafe like behavior (innerHTML's the result without
  sanitization) when bound to the result of $sce.trustAsHtml(string).
  When bound to a plain string, the string is sanitized via $sanitize
  before being innerHTML'd.  If $sanitize isn't available, it's logs an
  exception.
2013-07-25 14:29:56 -07:00
Chirayu Krishnappa bea9422ebf feat($sce): new $sce service for Strict Contextual Escaping.
$sce is a service that provides Strict Contextual Escaping services to AngularJS.

Strict Contextual Escaping
--------------------------

Strict Contextual Escaping (SCE) is a mode in which AngularJS requires
bindings in certain contexts to result in a value that is marked as safe
to use for that context One example of such a context is binding
arbitrary html controlled by the user via ng-bind-html-unsafe.  We
refer to these contexts as privileged or SCE contexts.

As of version 1.2, Angular ships with SCE enabled by default.

Note:  When enabled (the default), IE8 in quirks mode is not supported.
In this mode, IE8 allows one to execute arbitrary javascript by the use
of the expression() syntax.  Refer
http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx
to learn more about them.  You can ensure your document is in standards
mode and not quirks mode by adding <!doctype html> to the top of your
HTML document.

SCE assists in writing code in way that (a) is secure by default and (b)
makes auditing for security vulnerabilities such as XSS, clickjacking,
etc. a lot easier.

Here's an example of a binding in a privileged context:

  <input ng-model="userHtml">
  <div ng-bind-html-unsafe="{{userHtml}}">

Notice that ng-bind-html-unsafe is bound to {{userHtml}} controlled by
the user.  With SCE disabled, this application allows the user to render
arbitrary HTML into the DIV.  In a more realistic example, one may be
rendering user comments, blog articles, etc. via bindings.  (HTML is
just one example of a context where rendering user controlled input
creates security vulnerabilities.)

For the case of HTML, you might use a library, either on the client side, or on the server side,
to sanitize unsafe HTML before binding to the value and rendering it in the document.

How would you ensure that every place that used these types of bindings was bound to a value that
was sanitized by your library (or returned as safe for rendering by your server?)  How can you
ensure that you didn't accidentally delete the line that sanitized the value, or renamed some
properties/fields and forgot to update the binding to the sanitized value?

To be secure by default, you want to ensure that any such bindings are disallowed unless you can
determine that something explicitly says it's safe to use a value for binding in that
context.  You can then audit your code (a simple grep would do) to ensure that this is only done
for those values that you can easily tell are safe - because they were received from your server,
sanitized by your library, etc.  You can organize your codebase to help with this - perhaps
allowing only the files in a specific directory to do this.  Ensuring that the internal API
exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.

In the case of AngularJS' SCE service, one uses $sce.trustAs (and
shorthand methods such as $sce.trustAsHtml, etc.) to obtain values that
will be accepted by SCE / privileged contexts.

In privileged contexts, directives and code will bind to the result of
$sce.getTrusted(context, value) rather than to the value directly.
Directives use $sce.parseAs rather than $parse to watch attribute
bindings, which performs the $sce.getTrusted behind the scenes on
non-constant literals.

As an example, ngBindHtmlUnsafe uses $sce.parseAsHtml(binding
expression).  Here's the actual code (slightly simplified):

  var ngBindHtmlUnsafeDirective = ['$sce', function($sce) {
    return function(scope, element, attr) {
      scope.$watch($sce.parseAsHtml(attr.ngBindHtmlUnsafe), function(value) {
        element.html(value || '');
      });
    };
  }];

Impact on loading templates
---------------------------

This applies both to the ng-include directive as well as templateUrl's
specified by directives.

By default, Angular only loads templates from the same domain and
protocol as the application document.  This is done by calling
$sce.getTrustedResourceUrl on the template URL.  To load templates from
other domains and/or protocols, you may either either whitelist them or
wrap it into a trusted value.

*Please note*:
The browser's Same Origin Policy and Cross-Origin Resource Sharing
(CORS) policy apply in addition to this and may further restrict whether
the template is successfully loaded.  This means that without the right
CORS policy, loading templates from a different domain won't work on all
browsers.  Also, loading templates from file:// URL does not work on
some browsers.

This feels like too much overhead for the developer?
----------------------------------------------------

It's important to remember that SCE only applies to interpolation expressions.

If your expressions are constant literals, they're automatically trusted
and you don't need to call $sce.trustAs on them.
e.g.  <div ng-html-bind-unsafe="'<b>implicitly trusted</b>'"></div> just works.

Additionally, a[href] and img[src] automatically sanitize their URLs and
do not pass them through $sce.getTrusted.  SCE doesn't play a role here.

The included $sceDelegate comes with sane defaults to allow you to load
templates in ng-include from your application's domain without having to
even know about SCE.  It blocks loading templates from other domains or
loading templates over http from an https served document.  You can
change these by setting your own custom whitelists and blacklists for
matching such URLs.

This significantly reduces the overhead.  It is far easier to pay the
small overhead and have an application that's secure and can be audited
to verify that with much more ease than bolting security onto an
application later.
2013-07-25 13:00:35 -07:00
Braden Shepherdson fb7d891dac fix(ngMobile): emit click event for touchy clicks
Previously, no handlers for the click event would be called for the
fast, touch-based ngMobile clicks, only for desktop browser clicks. Now
the event will fire properly for all clicks.

Closes #3219
Closes #3218
Closes #3137
2013-07-24 19:02:06 -07:00
Igor Minar d87fa00423 fix(select): don't support binding to select[multiple]
changing the type of select box from single to multiple or the other way around
at runtime is currently not supported and the two-way binding does odd stuff
when such situation happens.

we might eventually support this, but for now we are just going to not allow
binding to select[multiple] to prevent people from relying on something that
doesn't work.

BREAKING CHANGE: binding to select[multiple] directly or via ngMultiple (ng-multiple)
directive is not supported. This feature never worked with two-way data-binding,
so it's not expected that anybody actually depends on it.

Closes #3230
2013-07-24 18:53:09 -07:00
Julien Bouquillon e03402433d fix(ngMobile): prevent ngClick when item disabled
- the ngClick attribute was always triggered, regardless the ngDisabled/disabled attributes
 - we now check the DOM disabled status before triggering the original click event

Closes #3124
Closes #3132
2013-07-24 16:58:12 -07:00
P. Envall 52b8211fd0 feat(ngRepeat): add $even and $odd props to iterator 2013-07-24 15:37:10 -07:00
Pawel Kozlowski 0fcd1e3b1f fix(form): pick the right attribute name for ngForm
Closes #2997
2013-07-24 14:22:05 -07:00
Rory Douglas 47a2a9829f fix(ngRepeat): handle iteration over identical obj values
Modifies default trackByIdFn to factor both key and value into hashKey
for non-array primitive (i.e. index not provided) values

Closes #2787
Closes #2806
2013-07-24 14:16:26 -07:00
Paul Meskers a13c01a8e4 fix(numberFilter): always convert scientific notation to decimal
Previously, the number filter would format small and large numbers
as scientific notation. It now uses toFixed() to ensure that all
requested digits are shown.
2013-07-24 12:05:41 -07:00
Dean Sofer 454bcfa438 docs(directive): Clarified and cleaned up directive guide
- corrected terminology about how directives use `require`
- added more variations to the DirectiveDefinitionObject
- removed some slightly superfluous text

docs(directive): Minor correction to example to avoid bad practice

Anchor tags should use `ng-href` instead of `href` for interpolation.

docs(directive): Supplementing DDO description

DDO = Directive Definition Object
Tweak recommended here:
https://github.com/angular/angular.js/pull/2888/files#r4664565
2013-07-24 11:34:22 -07:00
Brenton 1dcafd18af fix(equals): {} and [] should not be considered equivalent
angular.equals was returning inconsistent values for the comparison between
{} and []:

    angular.equals({}, []) // true
    angular.equals([], {}]) // false

Since these object are not of the same type, they should not be considered
equivalent.
2013-07-24 10:58:56 -07:00
Ken Sheedlo 4a7b6a4555 docs(minErr): Build minErr doc site 2013-07-24 10:42:20 -07:00
Pavel Vasek dca23173e2 fix($location): prevent infinite digest error due to IE bug
If an app uses HTML5 mode and we open an html5 url on IE8 or 9 which
don't support location href, we use location.replace to reload the page
with the hashbang equivalent of the url but this fails with infinite
digest. This is because location.replace doesn't update location.href
synchronously on IE8 and 9.

Closes #2802, #3305, #1417
2013-07-24 10:38:13 -07:00
Chirayu Krishnappa 0a3ec5f8bb fix($$urlUtils): use document instead of $document 2013-07-23 17:19:56 -07:00
Chirayu Krishnappa 7e49d37a98 fix($$urlUtils): remove dependency on $window
$window may be mocked out in tests causing those tests to fail.  So
don't use $window.
2013-07-23 15:08:42 -07:00
Braden Shepherdson dfa83475a5 docs(bootstrap): Note that ngScenario requires ngApp
ngScenario expects an ngApp directive to be used, and doesn't work for
manually bootstrapped apps. The failure mode is to hang on navigation.

Trying to make this wont-fix bug less obscure by documenting it.
Eventually Protractor will replace ngScenario and fix this.
2013-07-23 20:33:01 +01:00
Spencer 6476aed762 docs(cacheFactory): correct typos 2013-07-23 20:16:23 +01:00
Richard John db73a940fc docs(index): add seed app link to menu item 2013-07-23 20:09:44 +01:00
Jeff Cross 8653144953 fix(dump): Prevented window.dump from being overridden by karma-jasmine.
In commit 6820322db562382fac903be35831275948825317 of Karma-Jasmine, the
dependency on angular.dump was removed. This caused two undesirable side
effects in the angular.js project. 1) Tests for presence of mock dump were failing,
and 2) the default window.dump was not outputting valuable angular-aware info. This
simple fix adds window.dump in testabilityPatch, to preprocess dumped input prior
to passing it to the global dump method.
2013-07-23 11:00:58 -07:00
Igor Minar 717f24feb4 chore(dump): remove dead code
This code is not being used any more and the test is now failing
due to Karma changes. Karma used to expose window.dump but that
changed recently and that's why our build is now failing.

I'm removing the code and test, but we still need to figure out
how to route window.dump through angular.mock.dump, but that will
have to be a separate commit.
2013-07-22 13:59:27 -07:00
Igor Minar 45f9f62367 fix($compile): always instantiate controllers in parent->child order
Previously it was possible to get into a situation where child controller
was being instantiated before parent which resulted in an error.

Closes #2738
2013-07-22 11:27:53 -07:00
Igor Minar 3967f5f7d6 fix(Scope): ensure that isolate scopes use the main evalAsync queue
Previously any $evalAsync task scheduled from a isolate scope or a child of an isolate scope
would never execute because we never flushed this queue
2013-07-22 11:27:53 -07:00
Jérémy e14e21904a docs(input): fix example
The input [number] error spans did not show on the example, as they were
relying on an non-existing property (myForm.list.$error) vs the working
property (myForm.input.$error)
2013-07-21 21:06:40 +02:00
David Sanders fd45d590ef docs($window): improve style and clarify wording 2013-07-21 20:24:33 +02:00
Peter Fern bb8c3ec1a5 docs(ngRepeat): add example for filters in conjunction with track by 2013-07-21 17:14:17 +02:00
Chirayu Krishnappa b99d064b6d fix(core): parse URLs using the browser's DOM API 2013-07-19 01:44:57 -07:00
Brian Ford 715d97d5c8 test(ngRepeat): add a test for ngRepeat when using 'track by' and a filter 2013-07-18 16:10:38 -07:00
Pete Bacon Darwin ef4458a798 feat(Angular): provide minErr as public property
This allows us to use minErr in other modules, such as resource and sanitize.
2013-07-18 14:02:36 -07:00
Pete Bacon Darwin cd36cd86fc chore(sanitize): use minErr to throw exception 2013-07-18 14:02:36 -07:00
Pete Bacon Darwin aad29cbbf0 chore(resource): use minErr to throw exception 2013-07-18 14:02:36 -07:00
Pete Bacon Darwin 52123ae85b docs(jqLite): document "$destroy" event 2013-07-18 19:57:13 +01:00
Chirayu Krishnappa 3e39ac7e1b fix($compile): allow data: image URIs in img[src]
Ref: 1adf29af13

BREAKING CHANGE: img[src] URLs are now sanitized via a separate
    whitelist regex instead of sharing the whitelist regex with a[href].
    With this change, img[src] URLs may also be data: URI's matching
    mime types image/*.  mailto: URLs are disallowed (and do not make
    sense for img[src] but were allowed under the a[href] whitelist used
    before.)
2013-07-18 11:29:50 -07:00
Matias Niemelä e449c6df06 chore(ngdocs): fix improve button overlap 2013-07-18 18:53:20 +01:00
Andreas Sander 2bb27d4998 feat(directive): ng:focus, ng:blur
Added directives for focus and blur events.

Closes #1277
2013-07-18 19:24:42 +02:00
Spencer 1a8d83d660 docs($templateCache): add examples of usage 2013-07-17 16:40:51 +01:00
Bruno Coelho c8b54ad167 docs(dateFilter): fix typos
Fix closing parenthesis, quotes around string literal and remove
trailing whitespace.

Closes #3250
2013-07-17 11:22:10 +01:00
James deBoer 711a493709 test(utils): Adds a missing test for snake_case 2013-07-16 11:18:04 -07:00
Ken Sheedlo 7ec926ff56 fix(writer): fix makeDir directory tree bug 2013-07-16 11:13:36 -07:00
Matias Niemelä 031da1f96b fix($animator): ensure animations are always disabled for an element that is not attached to the DOM 2013-07-15 09:30:54 -07:00
Matias Niemelä 14626d0bc5 chore(gitignore): add libpeerconnection.log
Google chrome (when tested using karma) spits out a log file called libpeerconnection.log
2013-07-15 09:26:19 -07:00
Matias Niemelä 760a233703 chore(ngdocs): remove autofocus for the filtering search 2013-07-15 14:55:12 +01:00
Caio Cunha 2a5c355582 feat($q): added support to promise notification
It is now possible to notify a promise through deferred.notify() method.
Notifications are useful to provide a way to send progress information
to promise holders.
2013-07-14 23:11:46 -07:00
Chirayu Krishnappa d884eb80a1 test($q): improve logging of callback invocations 2013-07-14 23:11:46 -07:00
Lucas Galfasó a170fc1a74 feat(ngPluralize): add alternative mapping using attributes
Add an alternative way to define a mapping for ng:pluralize using
attributes instead of the `when` attribute

Closes #2454
2013-07-14 16:36:15 +02:00
sdesmond 1e649c5a81 docs(di): promote registering controllers on modules 2013-07-14 16:14:28 +02:00
David d7fde5fcb1 style(ngMock): add missing whitespace 2013-07-14 16:03:57 +02:00
Igor Minar b53c945bf5 fix(grunt): cache version number
caching the version number speeds up the build and preserves resources.

this also fixed EMFILE error that now occurs on some macs.
2013-07-13 23:41:47 -07:00
Ben Ripkens 724819e3cf fix(angular.equals): add support for regular expressions
Regular expression objects didn't used to be considered to be equal when using
'angular.equals'. Dirty checking therefore failed to recognize a
property modification.

Closes #2685
2013-07-13 22:22:28 -07:00
Vojta Jina 32f8a04c8f chore(package.json): fix name to work with latest NPM 2013-07-13 17:20:56 -07:00
Igor Minar 514dc0eb16 fix($http): allow interceptors to completely override headers
Closes #2770
2013-07-12 17:42:37 -07:00
Matias Niemelä 77c715d7ca chore(ngdoc): wrap all pages inside of a container tag for easy styling 2013-07-12 22:43:24 +01:00
Greg Thornton 5a294c8646 feat(Angular.js): skip JSON.stringify for undefined
Return early in `angular.toJson` if the object to be stringified is `undefined`.
IE8 stringifies `undefined` to `'undefined'` whereas other browsers return
`undefined`. This normalizes behavior and passes currently broken unit tests
in IE8.
2013-07-12 20:32:40 +02:00
Alex Olshansky ccda0f3509 style(ngdocs): fix minor CSS issues 2013-07-12 19:41:48 +02:00
Leandro Ostera b94ca12fa0 feat($resource): support an unescaped URL port
The colon character is used to identify parameters in $resource.
This meant that we had to escape the colon used in a port.
It turns out that this is not necessary if we assume that parameter
names cannot consist of only digits.
If the parameter consists only of numbers, then it's a port.

Closes #2778
2013-07-12 10:47:46 +01:00
Stephen Merity 22a9b1ac07 fix(ngScenario): select().option(val) should prefer exact value match
With select(...).option(val) it previously would select the first node
which contains the value, even if an exact match was available.
This fix prefers exact matches if available, otherwise it reverts
to the previous 'contains' behaviour for backwards compatibility.

Closes #2856
2013-07-12 10:05:23 +01:00
Pete Bacon Darwin 7fef06fef9 fix(sanitize): match URI schemes case-insensitively
According to RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1)
schemes such as http or mailto are case-insensitive. So links such as
http://server/ and HTTP://server/ are valid and equivalent.

Closes #3210
2013-07-12 09:29:21 +01:00
Wesley Cho 3371fc254a fix(ngSubmit): expose $event to ngSubmit callback 2013-07-11 17:24:30 -07:00
Mikk Kirstein 09a1e7af12 fix(ngValue): made ngValue to write value attribute to element 2013-07-11 14:58:35 -07:00
Julien Bouquillon 52d6a59902 feat(ngDocs): add links to source for API
- add tests
 - the link points to the gruntUtil.getVersion().number tree on github
2013-07-11 14:07:08 -07:00
Paulo Scardine 8bd6619b7e fix(scope): watches can be safely unregistered inside watch handlers
Closes #2915
2013-07-11 22:04:00 +01:00
Ben Holley 4e96334b5c style(sanitize): fix typo in variable names 2013-07-11 22:48:45 +02:00
Eric Subach a83ed0e6c3 refactor(Angular.js): remove code duplication
Closes #2890
2013-07-11 22:01:29 +02:00
Igor Minar e82d780c2e fix($injector): improve $injector:nomod error message
Closes #2695
2013-07-11 12:16:02 -07:00
Brian Ford 31631b2b28 chore(build): add check for merge conflicts, ddescribe, and iit 2013-07-11 11:38:34 -07:00
Igor Minar 03216760ec test(ngList): remove disabled test
this test fails and we don't have intentions on making it pass since
we never made a commitment to implement this feature.
2013-07-11 11:11:35 -07:00
Igor Minar de4b048b49 docs(ngList): fix example and add e2e test 2013-07-11 09:23:40 -07:00
sdesmond cd11cc1083 docs(guide): clarify example 2013-07-10 22:57:26 +02:00
sdesmond 13469e83fc docs(guide): example filter does not conditionally assign a color 2013-07-10 22:53:26 +02:00
Robert Fauver ded42c7431 docs(guide/di): fix typo 2013-07-10 22:26:49 +02:00
Tay Ray Chuan 220f0dbcf1 docs(contribute): improve git instructions 2013-07-10 22:18:44 +02:00
Lefteris Paraskevas 899f5d1457 docs(overview): fix typo
Removed repeated "the" in the sentence: The input invalidates itself by turning red when you enter invalid data or leave "the" the input fields blank (Line 137).
2013-07-10 22:09:15 +02:00
Igor Minar 87aeb78c0e style(input): remove ws 2013-07-10 12:54:49 -07:00
Mark Striemer 8a3e3f9eb3 docs(ngMock): correct verifyNoOutstandingExpectation example 2013-07-10 20:30:34 +02:00
Alex Olshansky ead9cb7fb4 fix(ngdocs): merge duplicate css class attributes 2013-07-09 14:35:55 +01:00
Marco Vito Moscaritolo f89ba38dcd docs(angular.identity): fix missing 'angular' in identity function 2013-07-09 14:31:21 +01:00
bolasblack a7150f1256 feat($http): accept function as headers value
So we can request with dynamic header value.

module.factory('Res', [
  '$resource'
  '$routeParams'
  'globalConfig'

function($resource, $routeParams, globalConfig) {
  resource('/url/:id', {id: "@id"}, {
    patch: {
      method: 'patch',
      headers: {
        'Authorization': function() {
          return "token " + globalConfig.token;
        }
      }
    }
  });
}]);
2013-07-08 08:55:20 -07:00
Pete Bacon Darwin 0d124e190b docs(ngModelController): provide a more intuitive example
The example directive, using contenteditable was not showing required
even if you cleared the content from it.

Closes #3156
2013-07-08 14:52:31 +01:00
Pete Bacon Darwin 96298f9179 docs(numberFilter): fix explanation of default fraction size
The default fraction size for the number filter is actually computed
from the `NUMBER_FORMATS.PATTERNS.maxFrac` value in the current locale.

Closes #3157
2013-07-08 11:23:15 +01:00
Daniel Luz 7829c50f9e fix(angular.equals): do not match keys defined in the prototype chain
Merely testing for object[key] will give incorrect results on keys
defined in Object.prototype.
Note: IE8 is generally broken in this regard since `for...in` never returns
certain property keys even if they are defined directly on the object.

See #2141 - partially merges this PR
2013-07-08 11:05:08 +01:00
Pete Bacon Darwin d88dc4a64f chore(grunt): tweak ng-closure-runner setup 2013-07-08 10:56:25 +01:00
tgkokk f59b9c6fbd docs(guide/e2e-testing): fix typos 2013-07-07 20:31:15 +01:00
basarat 861e0c75bd docs(input): ng-model doesn't work well with isolated scope directive
Closes #3123
2013-07-04 00:35:34 +01:00
Andrew O'Brien 0e9e0af975 docs(guide/directive): make directive controller minification-safe
It is best to emphasize that the "controller" property needs to be min safe

Closes #3125
2013-07-04 00:28:54 +01:00
Anders Hessellund Jensen fc8c9baa39 fix($compile): empty normalized href should pass sanitation check
Sometimes IE returns an empty string for its normalized href on a tags.
This should pass the sanitation check in $compile.

Closes #2219, #2593
2013-07-03 23:51:41 +01:00
Lucas Galfasó a59a5f386a fix(grunt): Give java 2g of memory
Give the java build process 2g of memory
2013-07-03 22:52:53 +01:00
Lucas Galfasó b3d7a038d7 fix(i18n): Do not transform arrays into objects
Do not trasnform arrays into objects when generating the locale objects
Add unit test for this check
2013-07-03 22:51:31 +01:00
Julien Bouquillon ef5bc6c7c3 fix($sniffer): detect transition/animation on older Android browsers
The stock Android browser doesn't support the current for-in body/style
detection for animations and transitions but we can manually fix this.
This is useful for PhoneGap web-views or traditional web-apps using the
stock browser.
2013-07-03 22:16:31 +01:00
Sebastian Müller 22b9b47576 refactor(core): use native String.prototype.trim if available 2013-07-03 01:42:41 -07:00
Chirayu Krishnappa 5349b20097 fix($parse): disallow access to Function constructor
Enhances sandboxing of Angular Expressions to prevent attacks via:

  {}.toString.constructor(alert("evil JS code"))
2013-07-03 00:03:56 -07:00
Joao Sa fd87eb0ca5 fix(jqLite): prepend array in correct order
Match jQuery behavior when prepending array into empty element
2013-07-02 23:24:51 -07:00
Vineet Kumar 3ffddad100 fix(ngCloak): hide element even when CSS 'display' is set
Previously an element like
<div class="foo ng-cloak">...</div>
would still be annoyingly visible if it matched a CSS rule like
.foo { display: inline-block; }, overriding ng-cloak's display: none.
2013-07-02 22:57:34 -07:00
exex zian c21ab0a68a docs(tutorial/step9): formatted Unicode character line
Add tick and cross mark corresponding to their respective unicodes.
2013-07-02 22:49:54 -07:00
Ken Sheedlo 6957971405 fix(bower): Use latest ng-closure-runner 2013-07-02 22:36:22 -07:00
Igor Minar 69f42b7654 fix($compile): prevent infinite loop w/ replace+transclude directives
Previously if a template contained a directive that had a template
(sync or async) and the directive template was to replace the original
element and the directive template contained another directive on the
root element of this template and this new directive was an element
transclude directive then an infinite recursion would follow because
the compiler kept on re-adding and reapplying the original directive
to the replaced node.

This change fixes that.

Closes #2155
2013-07-02 22:35:39 -07:00
Igor Minar cbbe3bfe91 revert: fix(compiler): corrects component transclusion on ...
This reverts commit 15e1a29cd0.

The original commit was fixing two issues - one of them was
preventing attributes that triggered directives that replaced
the compiled node to be merged into the new node.

This change was a breaking change (as seen in the diff of the
tests in this commit) and that's why it's being removed.

A proper fix will follow.
2013-07-02 22:35:39 -07:00
Pete Bacon Darwin 91e139e52a chore(grunt-utils): remove unnecessary quotes from minerr_url
The quotes were causing the minerr processing to fail on Windows
2013-07-02 22:35:06 +01:00
Vojta Jina 2c2adbcab5 chore(travis): speed up the build
- parallelize the tasks
- cache requests (e2e tests)

This reduces the time from ~18min to ~12min.

It makes the output little messy. We could buffer output of each task and display it once it's fully finished, nicely. I think giving instant feedback is better.
2013-07-02 13:58:52 -07:00
Pete Bacon Darwin 6e1b64176f chore(grunt-utils): fix java classpath on Windows 2013-07-02 20:58:37 +01:00
Igor Minar 726e0c246b test(ngRepeat): disable an element directive test on IE8 2013-07-02 11:11:52 -07:00
Igor Minar c46c5924c4 revert: test(ngRepeat): fix IE8 test compatibility issue
This reverts commit 0c6fb665a4.

The change invalidated the test because the point of the the test
was to test that an element directive works. Changing it to attribute
directive was wrong.
2013-07-02 11:07:59 -07:00
Igor Minar 4f0f243771 fix($injector): refactor module loading code and use minErr 2013-07-02 11:05:30 -07:00
Niall Smart 48eb297c11 docs(guide/location): fix example code - hashPrefix is a method 2013-07-02 10:01:02 +01:00
Igor Minar 52c538c269 fix(jqLite): rename jqLiteError to jqLiteMinErr 2013-07-01 16:04:08 -07:00
Ken Sheedlo c8fcf3b369 feat(minErr): Error stripping build step 2013-07-01 15:42:14 -07:00
Igor Minar 0c6fb665a4 test(ngRepeat): fix IE8 test compatibility issue 2013-07-01 14:30:43 -07:00
joshkurz 807394095b fix(Angular.js): handle duplicate params in parseKeyValue/toKeyValue
parseKeyValue and toKeyValue can now handle duplicate values in the query.
```
?x=1&x=2 <-> {x:[1,2]}
```

The algorithm looks like:
    1)parseKeyValue looks for presence of obj[key]
    2)detects and replaces obj[key] with [obj[key],val]
    3)then pushes more duplicates if necessary
    4)toKeyValue decodes array correctly
    5)(not changed)$location.search({param: 'key'}) still replaces if necessary
    6)(not changed)$location.search({param: ['key1', 'key2']}) sets the url with duplicates

BREAKING CHANGE: Before this change:
- `parseKeyValue` only took the last key overwriting all the previous keys;
- `toKeyValue` joined the keys together in a comma delimited string.
This was deemed buggy behavior. If your server relied on this behavior
then either the server should be fixed or a simple serialization of
the array should be done on the client before passing it to $location.
2013-07-01 19:32:12 +01:00
Vojta Jina a258817310 chore: add karma-script-launcher plugin
This plugin is shipped as a default one with Karma. It's specified as a peer dependency.

I assume, there's an old version of NPM on the CI server, which does not support peerDependencies and therefore it didn't get installed.

This will make the dependency explicit.
2013-07-01 10:15:08 -07:00
Itamar Rogel 06a9972228 docs($cacheFactory): show that you can access existing caches 2013-07-01 12:01:07 +01:00
Spencer Applegate 1532ec1dfe docs(Angular.js): explain that toJson strips $... properties
In Angular.toJson, any properties with a leading '$' character will be
stripped from the resulting string since angular uses this notation
internally for services.  There have been complaints of not knowing
about this functionality until it breaks within their code.
2013-07-01 11:35:16 +01:00
Chirayu Krishnappa a22596c925 test($compile): use FQDN for img[src]
img[src]="https://foo" has the unfortunate problem that the browser will
actually try retrieving the resource the non FQDN foo.  The local DNS
might suffix a domain to this, resolve it, and try to present a
certificate for the https request and prompt the user to pick a
certificate. This commit avoids that by making foo a FQDN.  Note that it
might be better to replace foo with example.com (ref
http://tools.ietf.org/html/rfc2606#section-3).
2013-06-28 17:38:11 -07:00
Chirayu Krishnappa 0e254cc88c chore(gitignore): add .agignore
I use a .agignore file to skip the build directory and some other files
while searching using Ag (see
https://github.com/ggreer/the_silver_searcher).
2013-06-28 13:04:31 -07:00
Vojta Jina ac04b87851 test(docs): fix invalid paths 2013-06-28 11:43:38 -07:00
Vojta Jina 33223e26a0 chore: set up Sauce Labs with Travis
This should not affect the Jenkins build at all.

Now, the Travis build uses Chrome on Sauce Labs, which in theory gives us opportunity to use any
browser/platform that Sauce Labs offers.
2013-06-28 11:43:38 -07:00
Vojta Jina 976edc1fc4 chore: clean up angularFiles.js 2013-06-28 11:43:38 -07:00
Vojta Jina 29f96c852c chore: update karma to 0.9.4
And also add shared config to make karma configs a bit simpler.
2013-06-28 11:43:38 -07:00
Vojta Jina 89efb12ed8 chore: remove jstd leftovers 2013-06-28 11:43:38 -07:00
Igor Minar b6b504b04c docs(misc/faq): remove obsolte t-shirt instructions 2013-06-28 11:27:32 -07:00
Igor Minar e1ec5c7963 chore(build): change logging level for e2e tests to info 2013-06-28 09:33:08 -07:00
Pete Bacon Darwin bd5c9a0371 style(ngRepeatSpec): fix up colons and iit 2013-06-28 08:28:06 +01:00
Igor Minar 15e1a29cd0 fix(compiler): corrects component transclusion on compilation root.
Closes# 2155
2013-06-27 21:30:24 -07:00
Igor Minar 344e195c60 chore(build): temporarily add more logging to debug flakiness on CI 2013-06-27 14:55:47 -07:00
Andrew Peterson 2adad3ab81 docs(ngBind): clarify some of the writing 2013-06-27 21:20:37 +01:00
Andrew Peterson 9d27b0af4c docs(ngPluralize): improve wording 2013-06-27 21:15:19 +01:00
Adam bad9d1b71f docs(guide/e2e-testing): clarify description of input(name) selector
The description of the input selector made it seem that you were selecting
an input element based upon it's name attribute. In reality, you are
selecting an element by the string in the ng-model attribute.
2013-06-27 20:45:53 +01:00
Pete Bacon Darwin fdab308278 docs(ngMock/$httpBackend): fix testing example
Closes #3075
2013-06-27 20:37:59 +01:00
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
Igor Minar b700aa9291 docs(faq): update customink order info 2013-06-10 11:39:01 -07:00
Igor Minar 4eaaf9f83c chore(.gitignore): fix patterns
make patterns more strict so we don't accidentaly match stuff deeply
nested in the codebase.
2013-06-07 23:03:13 -07:00
Pete Bacon Darwin 8011b97bfa chore(Gruntfile): ensure bower command is run under node 2013-06-07 20:24:26 +01:00
Igor Minar a4300efef9 chore(closure-compiler): upgrade to version 20130603 2013-06-06 23:10:28 -07:00
Igor Minar 73534b3546 chore(closure-compiler): use bower to fetch closure compiler
this replaces the stale NPM dependency
2013-06-06 23:10:09 -07:00
Matias Niemelä 0317fd1651 chore(ngdocs): expose showdown.js to docs pages and docs testing suite 2013-06-06 22:58:56 -07:00
Matias Niemelä 77c4fc6847 chore(ngdocs): setup karma-docs testing suite to test docs components 2013-06-06 22:58:56 -07:00
Matias Niemelä f56125d94e chore(ngdocs): setup bower as the package manager for the docs pages 2013-06-06 22:58:55 -07:00
Matias Niemelä 079bf5f275 chore(ngdocs): replace google closure library with a NPM module 2013-06-06 22:14:55 -07:00
Matias Niemelä 4949586a76 fix(ngdoc): fix the node warnings that show up during build 2013-06-06 22:13:43 -07:00
Matias Niemelä b36504577c feat(ngdocs): provide documentation for the new ngRepeat repeater syntax 2013-06-06 22:09:05 -07:00
Matias Niemelä 9faabd1ba0 chore(AngularPublic): remove angular.noConflict feature 2013-06-06 22:06:50 -07:00
Igor Minar 65f5e856a1 chore(ngdoc): fix deprecated node api path.existsSync -> fs.existsSync 2013-06-06 17:08:50 -07:00
Igor Minar 63c1e5beff chore(grunt): add autotest:modules target 2013-06-06 17:08:50 -07:00
Igor Minar 5599b55b04 refactor($route): pull $route and friends into angular-route.js
$route, $routeParams and ngView have been pulled from core angular.js
to angular-route.js/ngRoute module.

This is was done to in order keep the core focused on most commonly
used functionality and allow community routers to be freely used
instead of $route service.

There is no need to panic, angular-route will keep on being supported
by the angular team.

Note: I'm intentionally not fixing tutorial links. Tutorial will need
bigger changes and those should be done when we update tutorial to
1.2.

BREAKING CHANGE: applications that use $route will now need to load
angular-route.js file and define dependency on ngRoute module.

Before:

```
...
<script src="angular.js"></script>
...
var myApp = angular.module('myApp', ['someOtherModule']);
...
```

After:

```
...
<script src="angular.js"></script>
<script src="angular-route.js"></script>
...
var myApp = angular.module('myApp', ['ngRoute', 'someOtherModule']);
...
```

Closes #2804
2013-06-06 17:07:12 -07:00
Jared Forsyth 7a5cfb593f docs(guide/unit-testing): fix typo 2013-06-04 22:28:43 +01:00
Jared Forsyth 8400852f4e docs(guide/injecting_controllers): add a hint in example
Add a hint to tell the user that they need to click 3 times before an alert is shown.
2013-06-04 22:25:10 +01:00
Marcin Wosinek e1810c5cd3 docs(ngTransclude): fix outdated scope definition in example 2013-06-04 22:13:58 +01:00
Pete Bacon Darwin c785b2edff docs(guide/unit-testing): fix controller test example 2013-06-04 22:10:04 +01:00
Robbie Ferrero dc238ce123 docs(Angular.js): clarify ngApp usage 2013-06-04 22:01:11 +01:00
Robb Shecter 0921bd0816 docs(angular-mocks): fix typo in example
fromJSON() should be fromJson()
2013-06-04 21:53:43 +01:00
Alan Klement 76cb53f837 docs(sanitize): add @description section 2013-06-04 21:48:39 +01:00
Siddique Hameed ef5c874415 docs(index): make menu links relative
Before the Develop drop down menu items were hard coded with an absolute url,
which meant that they did not work correctly on local or ci server builds.
2013-06-04 21:08:29 +01:00
Luc Morin 8eb8c4a32f docs(ngClass): clarify the use of object map 2013-06-04 21:01:26 +01:00
Ehsan Ghandhari 4fd057e7c7 docs(guide/concepts): add comment as a type of directive 2013-06-04 20:53:39 +01:00
Robb Shecter d3d7b9e3ed docs(guide/understanding_model): improve example consistency 2013-06-04 20:50:09 +01:00
Manuel Kiessling 40acd186bc docs(guide/compiler): fix some minor language errors 2013-06-04 20:38:02 +01:00
Alex Young ffcfe7a86e docs(guide/di): fix some small grammatical issues 2013-06-04 20:30:43 +01:00
Jens Rantil 6a33aa63cd docs(validate-commit-msg): fix incorrect comment
If you `cd` into the repo, `validate-commit-msg.js` will be in the root
of it.
2013-06-04 20:23:51 +01:00
Luc Morin 303c7f9166 docs(input): provide explanation of how ngModel will affect the local scope 2013-06-04 20:16:07 +01:00
Eduardo Garcia a95bfbeac0 docs(guide): format snippets of code in plain text 2013-06-04 20:06:33 +01:00
adamshaylor c6fa3b06b1 docs(overview.ngdoc): clarify wording 2013-06-04 19:59:42 +01:00
Matias Niemelä b6a0777b24 fix(ngController): fix indentation bug which causes example to mess up 2013-05-31 06:35:44 -07:00
Lucas Galfasó c38073667d chore(docs): add reference to the blog
Add a reference to the blog at the documentation.
2013-05-30 23:43:27 -07:00
Jeff Cross e1a050e6b2 fix(jqLite): Added optional name arg in removeData
jQuery's API for removeData allows a second 'name' argument to just
remove the property by that name from an element's data. The absence
of this argument was causing some features not to work correctly when
combining multiple directives, such as ng-click, ng-show, and ng-animate.
2013-05-30 23:43:27 -07:00
Matias Niemelä a4b9a6aca9 fix($animator): ensure $animator calculates the highest duration + delay for and transitions and animations together 2013-05-30 22:01:42 -07:00
Gias Kay Lee a2f9e78a56 docs(): Rectify animator.animate documentation 2013-05-30 21:58:36 -07:00
Matias Niemelä 21c70729d9 feat(ngdocs): provide support for inline variable hinting 2013-05-30 21:42:41 -07:00
Misko Hevery e46100f709 feat($compile): support multi-element directive
By appending  directive-start and directive-end to a
directive it is now possible to have the directive
act on a group of elements.

It is now possible to iterate over multiple elements like so:

<table>
  <tr ng-repeat-start="item in list">I get repeated</tr>
  <tr ng-repeat-end>I also get repeated</tr>
</table>
2013-05-28 22:28:32 -07:00
Igor Minar b8ea7f6aba feat(ngError): add error message compression and better error messages
- add toThrowNg matcher
2013-05-24 17:03:21 -07:00
Vojta Jina 88eaea8e7b test(matchers): update toThrow matcher 2013-05-24 16:57:15 -07:00
Siddique Hameed 4179f62cc2 docs(guide/unit-testing): add expression example
* Improved developer guide, directive unit testing documentation code with scope expression
* Removed documentation block with nothing on it
2013-05-23 21:55:44 -07:00
Braden Shepherdson f4c6b2c789 feat($swipe): Refactor swipe logic from ngSwipe to $swipe service.
This new service is used by the ngSwipeLeft/Right directives, and by the
separate ngCarousel and swipe-to-delete directives which are under
development.
2013-05-23 16:07:44 -07:00
Alexander Shtuchkin 05772e15fb feat($resource): expose promise instead of only $then
- Instance or collection have `$promise` property which is the initial promise.
- Add per-action `interceptor`, which has access to entire $http response object.

BREAKING CHANGE: resource instance does not have `$then` function anymore.

Before:

Resource.query().$then(callback);

After:

Resource.query().$promise.then(callback);

BREAKING CHANGE: instance methods return the promise rather than the instance itself.

Before:

resource.$save().chaining = true;

After:

resource.$save();
resourve.chaining = true;

BREAKING CHANGE: On success, promise is resolved with the resource instance rather than http
response object.

Use interceptor to access the http response object.

Before:

Resource.query().$then(function(response) {...});

After:

var Resource = $resource('/url', {}, {
  get: {
    method: 'get',
    interceptor: {
      response: function(response) {
        // expose response
        return response;
      }
    }
  }
});
2013-05-23 14:18:29 -07:00
Michał Gołębiowski da5f537ccd fix(jqLite): correctly monkey-patch core jQuery methods
When real jQuery is present, Angular monkey patch it to fire `$destroy` event.

This commit fixes two issues in the jQuery patch:
- passing a selector to the $.fn.remove method (only fire `$destroy` on the matched elements)
- using `$.fn.html` without parameters as a getter (do not fire `$destroy`)
2013-05-23 12:05:55 -07:00
David Bennett 041f118b01 docs(input): add missing ngChange directive for email type
All other input types already have it.
2013-05-23 11:44:55 -07:00
Igor Minar 0272240400 docs(changelog): fix changelog formatting 2013-05-22 21:46:17 -07:00
Igor Minar 8b7b62c974 docs(changelog): add note about animation breaking change 2013-05-22 20:31:53 -07:00
Eddie Monge 18f14117de style(docs/template): add in missing semicolons
Add semicolons where they were missing in the docs section per Google
code styling guide.

Closes #2736
2013-05-22 22:51:16 +01:00
Jens Rantil 9d19b512e0 docs(guide/directive): clarify directive priority
Fixes #2644.
2013-05-22 21:09:20 +01:00
Igor Minar eef8f3438d chore(release): start 1.1.6 spooky-giraffe iteration 2013-05-22 01:12:01 -07:00
Igor Minar 9a7035e815 chore(release): cut the 1.1.5 triangle-squarification release 2013-05-22 01:05:11 -07:00
Igor Minar 5cc9837d93 docs(CHANGELOG.md): release notes for 1.1.5 and 1.0.7 releases 2013-05-22 01:02:59 -07:00
Joakim Blomskøld 59eb50204a docs(Angular.js): add missing @returns to extend() 2013-05-21 21:33:32 +01:00
Matias Niemelä 5bc2836a0d docs(tutorial): fix the float issue with the improve docs button 2013-05-21 14:02:19 +01:00
Ben Ripkens cdf75b302f docs(ngScenario): provide examples for element(...).query(fn)
element(selector, label).query(fn) is a very useful function, yet barely
explained. The developer guide should show how this function can be used
to conditionally execute behavior and assertions.
2013-05-21 13:36:17 +01:00
Jens Rantil 7f597a7509 doc($compile): clarify compile function return value
If a compile function (within a directive) returns a function, it is a
post-link function.

Closes: #2713
2013-05-21 13:17:51 +01:00
Jens Rantil 907d2f521e docs(guide/type): remove empty "Type" page in guide
Closes #1316
2013-05-21 13:12:41 +01:00
Igor Minar 0f7949c62a chore(version.js): remove unused/obsolete script 2013-05-21 03:42:57 -07:00
Igor Minar d458d7350b chore(package.json): kill version.yaml in favor of package.json
all versioning info is now in package.json and that's where the build scripts read it from
2013-05-21 03:39:36 -07:00
Dan Kohn eb21eb5a06 chore(package.json): use devDependencies instead of dependencies 2013-05-21 03:39:36 -07:00
Matias Niemelä 5a34464198 fix(ngdocs): fix gen_docs.sh 2013-05-20 14:39:02 -07:00
Matias Niemelä 5f92d4144e fix(ngdocs): provide test code for syntax links in docs and fix the syntax directive for IE8 2013-05-20 14:33:11 -07:00
Matias Niemelä 2f571a9c83 chore(ngdocs): move angular-bootstrap.js to be generated only inside the docs and remove from the build process 2013-05-20 14:27:34 -07:00
David Bennett 9f4f593711 feat($http): add support for aborting via timeout promises
If the timeout argument is a promise, abort the request when it is resolved.
Implemented by adding support to $httpBackend service and $httpBackend mock
service.

This api can also be used to explicitly abort requests while keeping the
communication between the deffered and promise unidirectional.

Closes #1159
2013-05-20 14:15:04 -07:00
Daniel Tse 27a8824b50 docs(filters): fix minor typographical error
Fix a typographical error "it's" -> "its" in the dateFilter
documentation
2013-05-20 15:36:10 +01:00
David Holmes 518a92651f doc(guide/compiler): fix grammatical error
"The compilation process happens into two phases." should be "The compilation process happens in two phases."
2013-05-20 10:24:12 +01:00
Misha Moroshko 5c203240d4 doc(filter): remove invalid character 2013-05-20 10:19:18 +01:00
Pete Bacon Darwin be993528a3 docs(guide::testing): fix link to angular-seed 2013-05-18 22:17:15 +01:00
Chris M 3b69eaebcd docs(ngMock::$log): improve the $log.*.logs descriptions
Because ngDoc generation only takes the last segment of a property name,
each $log.[error|warn|log...].logs property has the same name and is
confusing in the docs.
This commit helps this by adding a link to the $log.* method and also an
appropriate usage example.
2013-05-18 22:13:58 +01:00
Joakim Blomskøld 782a82d461 doc(ngModel): $setViewValue calls all parsers, not formatters 2013-05-18 21:17:51 +01:00
Ben Ripkens 2ab4fde817 docs(guide): add API documentation for ngScenario matchers
Matchers are briefly mentioned in the e2e test guide, but there is no
documentation for the available matchers.
2013-05-18 21:00:45 +01:00
Andrew Vida 1c7741329f docs(tutorial): update test config file name 2013-05-18 20:29:17 +01:00
Jeremy Wilken a7ba27b92c doc(guide:$location): fix example for two way databinding.
When you are watching the $location.path(), it has to be wrapped in a
function since it is not attached to the scope and if you pass a string
to $scope.$watch it is evaluated against the $scope.
2013-05-17 19:16:55 +01:00
Zach Snow 2a7043fa23 test($parse): improve clarity of ternary tests 2013-05-17 06:46:09 +01:00
Igor Minar 8f69ffce47 chore(docs): fix syntax error in docs.css 2013-05-16 16:39:13 -07:00
Matias Niemelä c53d4c9430 feat($animator): provide support for custom animation events 2013-05-16 16:17:46 -07:00
Matias Niemelä 24ed61cf5c test($animator): ensure invalid $sniffer.transitions and $sniffer.animations flags are caught in animation spec code 2013-05-16 16:17:46 -07:00
Matias Niemelä 3a49b7eec4 feat(ngdocs): Add FullText search to replace Google search in docs 2013-05-16 16:17:46 -07:00
Julie 0401a7f598 fix(jqLite): pass a dummy event into triggerHandler
Previously, anchor elements could not be used with triggerHandler because
triggerHandler passes null as the event, and any anchor element with an empty
href automatically calls event.preventDefault(). Instead, pass a dummy event
when using triggerHandler, similar to what full jQuery does. Modified from
PR #2379.
2013-05-16 16:15:31 -07:00
Zach Snow 6798fec439 feat($parse): add support for ternary operators to parser
Add '?' token to lexer, add ternary rule to parser at
(hopefully) proper precedence and associativity (based
on https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Operator_Precedence).
Since (exp1 && exp2 || exp3) is supported by the parser,
and (exp1 ? exp2 : exp3) works the same way, it seems
reasonable to add this minor form of control to templates
(see #719).
2013-05-16 22:30:37 +01:00
Ryan Schumacher cefbcd470d fix($resource): null default param results in TypeError
Fixes issue when setting a default param as `null` error
`TypeError: Cannot read property 'charAt' of null`
2013-05-16 14:26:08 -07:00
Daniel Stockton f9b897de4b feat($http): add a default content type for PATH requests
The default header is now application/json which while not perfect
in all cases is better than the browser default application/xml.

The new headers also makes for better compatibility with Rails 4
2013-05-16 14:05:05 -07:00
Matt Haggard 1f99c3a521 doc(guide): add links to angular-seed examples
The examples in the angular-seed project are better than nothing,
which is what we currently have here!
2013-05-16 22:02:16 +01:00
Dean Sofer a380fc4624 docs(ngCsp): add more informative details
Transferred from https://github.com/angular/angular.js/wiki/Using-AngularJS-in-a-Chrome-Extension-environment
2013-05-16 21:22:07 +01:00
jamesBrennan 99cd86a96e docs(guide:understanding_controllers): remove outdated info
Remove the outdated info in this document related to this API change
https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js#L166
2013-05-15 21:32:15 +01:00
Samuel Santos d551d72924 feat(ngSrcset): add new ngSrcset directive
In line with ngSrc and ngHref, this new directive ensures that the
`srcset` HTML5 attribute does not include a pre-interpolated string.
Without it the browser will fetch from the URL with the literal text
`{{hash}}` until AngularJS replaces the expression inside `{{hash}}`.

Closes #2601
2013-05-14 21:29:21 +01:00
Andreas Marek 629fb37351 feat(scenario): adds mousedown and mouseup event triggers to scenario
Added mousedown and mouseup event triggers to scenadio dsl 'element' expression.
Added mousedown and mouseup to the custom jquery trigger method to generate real events.
2013-05-14 20:50:36 +01:00
Siddique Hameed 908821e20a docs($timeout): minor cleanup
Added a comma separator in the statement
Removed the word the from the statement
Used whose instead of who's in the following statement
Italicized false in the statement
Used a comma separator in the statement
2013-05-14 20:47:39 +01:00
Glenn Goodrich 53061363c7 feat($resource): collapse empty suffix parameters correctly
Previously only repeated `/` delimiters were collapsed into a
single `/`.  Now, the sequence `/.` at the end of the template, i.e.
only followed by a sequence of word characters, is collapsed into a single
`.`. This makes it easier to support suffixes on resource URLs.
For example, given a resource template of `/some/path/:id.:format`, if
the `:id` is `""` but format `"json"` then the URL is now
`/some/path.json`, rather than `/some/path/.json`.

BREAKING CHANGE: A `/` followed by a `.`, in the last segment of the
URL template is now collapsed into a single `.` delimiter. For example:
`users/.json` will become `users.json`. If your server relied upon this
sequence then it will no longer work. In this case you can now escape the
`/.` sequence with `/\.`
2013-05-14 20:01:15 +01:00
quazzie c32a859bdb feat(select): match options by expression other than object identity
Extend ng-options with a new clause, "track by [trackByExpression]", which can be used when
working with objects.  The `trackByExpression` should uniquely identify select options objects.
This solves the problem of previously having to match ng-options objects by identity.
You can now write: `ng-options="obj as obj.name for obj in objects track by obj.id"`
The "track by" expression will be used when checking for equality of objects.

Examples:
<select
    ng-model="user.favMovieStub"
    ng-options="movie as movie.name for movie in movies track by movie.id">
</select>

scope: {
  user: { name: 'Test user', favMovieStub: { id: 1, name: 'Starwars' } }
  movies: [{ id: 1, name: 'Starwars', rating: 5, ... }, { id: 13, ... }]
}

The select input will match user favMovieStub to the first movie in the movies array, and show
"Star Wars" as the selected item.
2013-05-14 19:58:05 +01:00
Matias Niemelä 4acc28a310 feat(ngAnimate): cancel previous incomplete animations when new animations take place 2013-05-13 21:09:43 -07:00
Matias Niemelä c8197b44eb feat(ngdocs): external links to github, plunkr and jsfiddle available for code examples 2013-05-13 16:55:14 -07:00
Matias Niemelä b6e5972eb3 chore(ngdocs): update to new version of FontAwesome 2013-05-13 16:55:14 -07:00
Matias Niemelä 0930d9dfe7 chore($sniffer): replace remaining supportsTransitions/supportsAnimations flags inside tests 2013-05-13 18:12:25 -04:00
Matias Niemelä 3e4d43b42c docs(animation): fix code example to work with most recent ngAnimate
ngAnimate: Rename CSS classes in example code to work with new ngAnimate naming conventions
ngInclude: Include animations toggle in ngInclude example code
ngAnimate: Remove ms- prefix and fix up CSS animation example code
2013-05-13 14:09:03 +01:00
Chirayu Krishnappa 3952d35abe fix($browser): should use first value for a cookie.
With this change, $browser.cookies()["foo"] will behave like
docCookies.getItem("foo") where docCookies is defined at
https://developer.mozilla.org/en-US/docs/DOM/document.cookie

This fixes the issue where, if there's a value for the XSRF-TOKEN cookie
value with the path /, then that value is used for all applications in
the domain even if they set path specific values for XSRF-TOKEN.

Closes #2635
2013-05-11 09:28:14 -07:00
willtj bffe6fa8a6 docs($scope): clarify documentation for $broadcast 2013-05-10 21:24:08 +01:00
veselinn ac8ba104d4 docs(guide): fix a typo 2013-05-10 20:52:18 +01:00
Lucas Galfasó 67a4a25b89 fix(ngPluralize): handle the empty string as a valid override
Fix the check for overrides so it is able to handle the empty string

Closes #2575
2013-05-10 20:03:24 +01:00
Alfred Nutile f6caab598f docs(guide): fix typo on model name 2013-05-10 14:58:00 +01:00
Alex Pods 04d4c738b5 docs(Angular.js) move forEach docs to correct place 2013-05-09 22:04:13 +01:00
Anatoly Shikolay 4ae4f1edd2 style(*): fix up semicolon and var usage 2013-05-09 15:01:22 +01:00
Pete Bacon Darwin 40c36ee7fe docs(tutorial): add comment about injection annotation
Closes: #1163
2013-05-09 13:56:36 +01:00
Pete Bacon Darwin 02ad012e7f docs($window): fix example 2013-05-09 12:47:41 +01:00
Misko Hevery 29efd39745 fix(scenario): update to use our angular-scenario.js rather then karma 2013-05-08 16:40:35 -07:00
Matias Niemelä 11f712bc3e chore(ngAnimate): CSS classes X-setup/X-start -> X/X-active
BREAKING CHANGE: css classes foo-setup/foo-start become foo/foo-active

The CSS transition classes have changed suffixes. To migrate rename
.foo-setup {...} to .foo {...}
.foo-start {...} to .foo-active {...}

or for type: enter, leave, move, show, hide

.foo-type-setup {...} to .foo-type {...}
.foo-type-start {...} to .foo-type-active {...}
2013-05-08 16:03:31 -07:00
Matias Niemelä 14757874a7 feat(ngAnimate): Add support for CSS3 Animations with working delays and multiple durations 2013-05-08 15:56:53 -07:00
Matias Niemelä 88c3480aff feat($sniffer): Add support for supportsAnimations flag for detecting CSS Animations browser support 2013-05-08 15:40:37 -07:00
Matias Niemelä 0cb04e2e91 chore(ngIf): Add animation code to ngIf example and docs text to ngAnimate docs 2013-05-08 15:34:35 -07:00
Matias Niemelä 404c9a653a feat(ngdocs): add variable type hinting with colors 2013-05-08 15:25:56 -07:00
Igor Minar ee2689051b refactor($resource): simplify url template expansion 2013-05-08 15:08:49 -07:00
Igor Minar 5137a15417 chore(docs): use done() in gen-docs.js 2013-05-08 07:57:34 -07:00
Igor Minar 35adade6ac test(sortedHtml): ignore bogus rowspan=1 and colspan=1 in IE 2013-05-08 07:57:34 -07:00
Igor Minar 86b33eb3f1 test(sortedHtml): fix comment support in sortedHtml helper 2013-05-08 07:57:34 -07:00
Igor Minar 202087f03d style($compile): clarify argument name 2013-05-08 07:57:33 -07:00
R. Merkert 6d0b325f7f fix(angular): do not copy $$hashKey in copy/extend functions.
Copying the $$hashKey as part of copy/extend operations makes little
sense since hashkey is used primarily as an object id, especially in
the context of the ngRepeat directive. This change maintains the
existing $$hashKey of an object that is being copied into (likewise for
extend).
It is not uncommon to take an item in a collection, copy it,
and then append it to the collection. By copying the $$hashKey, this
leads to duplicate object errors with the current ngRepeat.

Closes #1875
2013-05-08 12:45:32 +01:00
Illniyar cf4729faa3 feat($cookieStore): $cookieStore.get now parses blank string as blank string
closes #1918
2013-05-08 10:04:07 +01:00
Kevin Wells 4f2e360685 fix(date): correctly format dates with more than 3 sub-second digits
This date {{2003-09-10T13:02:03.123456Z | date: yyyy-mm-dd ss} is now
treated as having 123.45ms. Previously it had 123456ms so 123 seconds
were added to the formatted date.
Use local date in unit tests so they work in any time zone
2013-05-07 22:59:46 +01:00
Chad Smith 4622af3f07 fix(select): ensure empty option is not lost in IE9
Fix a check inside render for select elements with ngOptions, which
compares the selected property of an element with it's desired state.
Ensure the placeholder, if available, is explicitly selected if the model
value can not be found in the option list.
Without these fixes it's up to the browser implementation to decide which
option to choose. In most browsers, this has the effect of displaying the
first item in the list. In IE9 however, this causes the select to display
nothing.

Closes #2150, #1826
2013-05-07 21:27:42 +01:00
Pete Bacon Darwin f046f6f73c fix(dateFilter): correctly format ISODates on Android<=2.1
In older Android browsers, `undefined` does not act like `0` in some
arithmetic operations. This leads to dates being formatted with `NaN`
strings in the dateFilter because the implementation of the `dateGetter`
function allows offset to be an optional parameter.
The fix is to convert offset to 0 if it is undefined.

Closes #2277, #2275
2013-05-07 11:43:25 +01:00
Hamish Macpherson 52c1498e25 doc(input): fix small typo in code example 2013-05-07 09:48:40 +01:00
Misko Hevery 2c69a6735e fix($location): prevent navigation when event isDefaultPrevented 2013-05-06 21:52:53 -07:00
Misko Hevery c575a56fc5 docs(injector): add docs for $injector.has 2013-05-06 21:52:53 -07:00
Matthieu Larcher af0eaa3047 feat(ngInclude): $includeContentRequested event
Adding a $includeContentRequested event in order to better keep track of
how many includes are sent and be able to compare it with how many have
finished.
2013-05-03 19:55:47 +01:00
Misko Hevery a348e90aa1 fix($location): compare against actual instead of current URL 2013-05-02 18:22:03 -04:00
Misko Hevery 4bd7bedf48 fix($location): prevent navigation if already on the URL 2013-05-02 15:22:17 -04:00
Misko Hevery fd21c7502f fix(ngAnamite): eval ng-animate expression on each animation 2013-05-02 15:22:16 -04:00
Misko Hevery 80341cb9ba feat(injector): add has method for querying
Closes #2556
2013-05-02 15:22:16 -04:00
Misko Hevery 9956baedd7 fix(ngView): accidentally compiling leaving content
closes: #2304
2013-05-02 15:22:16 -04:00
Gonzalo Ruiz de Villa 1d8e11ddfb fix(ngRepeat): correctly iterate over array-like objects
Check if the object is array-like to iterate over it like it's done with arrays.

Closes #2546
2013-05-02 15:12:37 +01:00
Gonzalo Ruiz de Villa 6452707d40 fix($rootScope) ensure $watchCollection correctly handles arrayLike objects 2013-05-02 15:12:37 +01:00
quazzie dc9a580617 fix($location): back-button should fire $locationChangeStart
Before $locationChangeStart event is not broadcast when pressing the back-button on the browser.

Closes #2109
2013-05-01 14:42:10 +01:00
Pete Bacon Darwin 660605bdb8 test(ngAnimate): also provide W3C transition property to work on IE10
Closes: #2492
2013-05-01 13:57:44 +01:00
Siddique Hameed 89c0b5d096 docs(injector): fix typo
Closes: #2551
2013-05-01 13:14:54 +01:00
Braden Shepherdson 52a55ec618 feat(ngTap): Add a CSS class while the element is held down. 2013-04-30 16:56:24 -07:00
Vojta Jina e295eeefaa test(controller): instantiate controller defined on window
Just adding a missing spec.
2013-04-30 14:38:14 -07:00
Vojta Jina de2cdb0658 fix(ngController): allow dots in a controller name
The issue was introduced in cd38cbf975
2013-04-30 14:38:14 -07:00
David Bennett cda7b71146 feat($httpBackend): add timeout support for JSONP requests
Documentation implies that timeout works for all requests, though it
only works with XHR. To implement:
- Change $httpBackend to set a timeout for JSONP requests which will
immediately resolve the request when fired.
- Cancel the timeout when requests are completed.
2013-04-30 20:42:34 +01:00
Chris Nicola fc25a443f8 docs(guide:directive): add directive controller usage
Specifically adding a directive controller to the example definition
and how to use declare injectables to avoid minification errors.
2013-04-30 10:47:14 +01:00
Robin Böhm d6984db4d5 style($injector): add a comment to explain the distinction with isArray 2013-04-30 10:39:33 +01:00
Eugene Wolfson ef7ba7b212 docs($provide): fix parentheses in example 2013-04-30 10:16:24 +01:00
Matias Niemelä b3a62b2e19 feat(ngdocs): support for HTML table generation from docs code 2013-04-29 17:43:14 -04:00
Misko Hevery 400f9360bb fix(ngController): change controllerAlias to controllerAs. 2013-04-29 14:28:54 -04:00
Lucas Galfasó 7812ae75d5 fix(parse): Fix context access and double function call
Fix a context duplication and invocation to a previous context when
doing an access modifier function on the result of a function
Currently, when doing `foo().bar()`, `foo` is called twice, the first
time to get the context and the second one for `bar` to get the
underlying object. Then the call to `bar` is called using the second
instance as self
This is equivalent to doing:
```
var instance1 = foo();
var instance2 = foo();
instance2.bar.apply(instance1);
```

Closes #2496
2013-04-29 19:16:21 +01:00
Lucas Galfasó da8c320bde test(parse): Test for the parsing not invoking twice to get self
New tests to not call twice a function to get self
2013-04-29 19:12:19 +01:00
gockxml 06f2b2a8cf fix(jqLite): correct implementation of mouseenter/mouseleave event
Implement mouseenter/mouseleave event referring to
http://www.quirksmode.org/js/events_mouse.html#link8 and jQuery source
code(not dependent on jQuery).
The old implementation is wrong. When moving mouse from a parent element
into a child element, it would trigger mouseleave event, which should not.
And the old test about mouseenter/mouseleave is wrong too. It just
triggers mouseover and mouseout events, cannot describe the process of mouse
moving from one element to another element, which is important for
mouseenter/mouseleave.

Closes #2131, #1811
2013-04-29 18:26:32 +01:00
Oren Avissar 0985a37376 test(browser/compile): fix calls to Jasmine fail()
The fail() function in Jasmine expects an Error object parameter.
Also, there is no global alias for fail() so it must be accessed using
`this.fail(new Error())`.
2013-04-29 16:56:35 +01:00
Robin Böhm cb62a57d43 refact(ngClass): improve performance through bitwise operations
Change modulo % 2 operations to bitwise & 1
Read about this in Nicholas C. Zakas book "High Performance JavaScript"(ISBN: 978-0-596-80279-0)
Use the Fast Parts --> Bitwise Operators --> Page 156++
Proven at http://jsperf.com/modulo-vs-bitwise/11
2013-04-29 10:19:07 +01:00
Jamie R. Rytlewski 61c0adedc3 docs($q): fix typo 2013-04-28 18:44:07 +01:00
Anton 8a59d8668c docs(contribute): add Java as dependency
Current build process leverages closure jar for javascript minification.
If Java is not installed and included in the PATH the build will fail.
2013-04-28 18:37:24 +01:00
Andreas Pelme 32719c7976 docs(route): fix typo in route documentation 2013-04-26 13:16:19 +01:00
Pete Bacon Darwin 77ff108555 fix(location): correctly rewrite Html5 urls 2013-04-25 19:08:41 +01:00
Pete Bacon Darwin 0fbf584643 test(location): should not rewrite Html5 deep urls 2013-04-25 19:08:41 +01:00
Paulo Ávila 5a8ae94f9c docs(filter): improve syntax for usage in templates 2013-04-24 21:55:58 +01:00
Laurent Cozic 6605adf6d9 feat($q): add $q.always() method
Add $q.always(callback) method that is always called whether the promise is successful or fails; includes unit tests and updates
documentation.
2013-04-24 20:56:18 +01:00
Jeff Pickelman b1157aafd7 docs(di): fix typos and grammar 2013-04-24 20:52:25 +02:00
Timothy Ahong 2d5297e665 docs(guide:unit-testing): add an example unit test for directives 2013-04-23 14:00:14 +01:00
Misko Hevery cd38cbf975 feat(controller): support as instance syntax
Support ng-controller="MyController as my" syntax
which publishes the controller instance to the
current scope.

Also supports exporting a controller defined with route:
````javascript
angular.module('routes', [], function($routeProvider) {
  $routeProvider.when('/home', {controller: 'Ctrl as home', templateUrl: '...'});
});
````
2013-04-22 23:28:41 -07:00
Misko Hevery 021bdf3922 fix($animator): remove dependency on window.setTimeout. 2013-04-22 23:13:26 -07:00
Pete Bacon Darwin de296f1b52 docs(compiler): don't drag selected content
In the example with draggable, the mouseDown handler needs to start with an event.preventDefault(). Otherwise the following bug occurs:
1) Select the text of the draggable span by clicking outside the span and dragging the mouse to the left or right through the span. Release the mouse button.
2) Now click on the span's inner text, and start to Drag it. The browser's default functionality that drags highlighted text so that it can be pasted into something else (say a document in a text editor) is invoked.
3) Release the mouse button. Now suddenly, you'll be dragging the span. But you won't be able to place it down on the page. It'll just follow the mouse around until the page is refreshed.

Closes: #2465
2013-04-22 13:38:18 +01:00
Keir Mierle 8c75b5f55a docs(compiler): fix variable scope in drag sample
Note that without this fix, if you add a second draggable element, the
two instances clobber each other since there is only one set of
startx/starty/x/y variables.
Here is an example: http://plnkr.co/edit/aGrLXcIo2SuaePuAdfmQ?p=preview.
On the surface it looks like it would be fine because you only have one
mouse but in practice the start position jumps when you start dragging.
Here it is fixed: http://plnkr.co/edit/VuvPasuumtCeiVRisYKQ?p=preview
2013-04-22 12:52:08 +01:00
Keir Mierle 2d66ccd593 docs(forms): fix formatting 2013-04-22 12:38:26 +01:00
Ron Yang af9c20c07d docs(forms): fix typo 2013-04-22 12:34:38 +01:00
Paulo Ávila 2c34596b32 docs(guide): minor grammatical change 2013-04-21 19:53:52 +02:00
Tyler Akins 59c29e320a chore(ngDoc): fix a typo with IE warning 2013-04-19 21:56:39 +01:00
Oren Avissar 2f96fbd175 feat(ngIf): add directive to remove and recreate DOM elements
This directive is adapted from ui-if in the AngularUI project and provides a complement
to the ngShow/ngHide directives that only change the visibility of the DOM element and
ngSwitch which does change the DOM but is more verbose.
2013-04-19 21:45:38 +01:00
Merrick Christensen 8a2bfd7a78 docs(concepts): fix spelling error 2013-04-19 14:44:14 +01:00
Jared Beck 1d3e79e24e docs(overview): correct the input validation example
The documentation says that the input should be red if you enter
invalid values or leave it blank. Because the type="integer" is not
supported this does not happen in practice.  This fix changes the
input type to number and adds an ng-pattern to ensure that the number
is an integer.
2013-04-19 14:39:58 +01:00
leesei 120b9190ea docs(input): fix typo on max attribute 2013-04-19 13:43:09 +01:00
Shyam Seshadri f77b906d67 docs(select): fix attribute documentation
Select documentation was still referring to binding to name, when it should be ng-model instead. Fixed it.
2013-04-19 13:36:22 +01:00
Michal Reichert 4c7baf970f docs(ngBind): fix typo 2013-04-19 11:55:16 +01:00
Igor Minar 5da6b125a7 test(modules): fix module tests which got disabled by ngMobile
When ngMobile was merged in, we accidentaly included angular-scenario.js
in the test file set for modules. Loading this file overrode jasmine's
`it` and `describe` global functions which essentially disabled all of
~200 unit tests for wrapped modules.

This change refactors the code to run the wrapped module tests.

I had to extract browserTrigger from scenario runner in order to achieve
this without code duplication.
2013-04-18 14:34:53 -07:00
Pete Bacon Darwin 695c54c17b fix(i18n): escape all chars above \u007f in locale files
Modify the script that writes the locales so all characters above \u007f are escaped
Includes the updated locale files after running the closureI18nExtractor.

Closes #2417
2013-04-17 22:13:49 +01:00
Mark Dalgleish 363e4cbf64 fix(ngModel): use paste/cut events in IE to support context menu
In IE the model is not updated when the input value is modified using the context
menu, e.g. pasting from the clipboard, or cutting all or part of the current value.
To capture these changes, we bind to the proprietary 'paste' and 'cut' events.

Closes #1462
2013-04-17 21:20:08 +01:00
es128 c4d5631f1a doc(ngClassEven): make consistent with ngClassOdd 2013-04-17 14:51:41 +01:00
@fbiville fd91d86f0c docs(directive guide) typo in compile/link section
The code snippet shows `{{action.description}}`, the explanation referred to it as `{{action.descriptions}}`.
2013-04-17 14:50:19 +01:00
@fbiville 9f2aaca65b docs(injector): fix typo in inlining example
The actual invoke call in the documentation was referring to the non-existent tempFn instead of tmpFn
2013-04-17 14:46:13 +01:00
austingreco 12b6deb1ce fix(ngPattern): allow modifiers on inline ng-pattern
Add support for regex modifiers on inline `ng-pattern`.
`ng-pattern="/regex/i"` now validates correctly.

Closes #1437
2013-04-16 14:49:17 -07:00
Timothy Ahong a91405889f docs(guide.unit-testing): fix typo 2013-04-16 21:04:09 +01:00
Francesc Rosàs b8f0b432fd docs($q): fix incorrect @returns tag for $q.when() 2013-04-16 13:37:07 +01:00
Pete Bacon Darwin 0ac969a5ee fix(ngClass): should remove classes when object is the same but property has changed
If you wire up ngClass directly to an object on the scope, e.g. ng-class="myClasses",
where scope.myClasses = { 'classA': true, 'classB': false },
there was a bug that changing scope.myClasses.classA = false, was not being picked
up and classA was not being removed from the element's CSS classes.

This fix uses angular.equals for the comparison and ensures that oldVal is a copy of
(rather than a reference to) the newVal.
2013-04-16 13:15:49 +01:00
Pete Bacon Darwin 465238613b fix(Grunt): also remove \r chars when joining files 2013-04-16 12:13:55 +01:00
Misko Hevery 58ef32308f fix($location): fix URL interception in hash-bang mode
Closes #1051
2013-04-15 12:05:27 -07:00
Pete Bacon Darwin 59bfe8e5a9 docs(tutorial): testacular renamed to karma
Replaced instances of 'Testacular' with 'Karma' to reflect name change of test runner.
Replaced instances of 'http://vojtajina.github.com/testacular' with 'http://karma-runner.github.io/' to reflect dedicated page for Karma Test Runner.
Added location of config file needed to start the Karma server. This is still labeled 'testacular.conf.js' and needs file name to be updated in the phone example repo.
2013-04-15 12:28:31 +01:00
Pete Bacon Darwin a748410f52 docs(rootScope): fix typo 2013-04-15 11:44:49 +01:00
Laurent c25343f8be docs(rootScope): Fix various typos 2013-04-15 11:42:57 +01:00
Laurent cc1e4225b7 docs(Angular.js): fix typo 2013-04-15 11:42:34 +01:00
Pete Bacon Darwin 5d1f37b535 doc(overview): add link to angular demo slides to overview 2013-04-15 11:20:46 +01:00
brandonjp c746d65857 docs(ngController): fix docs link to api/ng.$route 2013-04-13 18:24:40 +02:00
Seunghoon Yeon 0d8a95af6f docs(module): fix typo 2013-04-13 17:19:11 +02:00
Igor Minar ab755a25f9 fix(Scenario): correct bootstrap issue on IE
we need to set the deferred bootstrap flag via window.name after the iframe's
src has been set, otherwise IE will reset it to empty string
2013-04-13 00:42:51 -07:00
uberspeck b7b08eed02 docs(faq): added note to FAQ re: legacy IE support 2013-04-12 15:58:29 -07:00
Misko Hevery 570463a465 fix(ngAnimate): prevent animation on initial page load 2013-04-11 23:06:07 -07:00
Matias Niemelä 3c3247fe17 fix(ngdocs): improve the animations used in the docs menu 2013-04-11 23:06:07 -07:00
Misko Hevery a0bc71e271 fix(ngRepeat): prevent initial duplicates 2013-04-11 23:06:07 -07:00
Dave Geddes a491ea3791 chore(Grunt) update grunt-contrib-copy
grunt-contrib-copy@0.4.1 has the cleaner summary output by default
2013-04-11 16:28:10 -07:00
Lee Leathers fe1696f688 style(exceptionHandler): add ws 2013-04-11 15:32:20 -07:00
Lee Leathers c3a87c6849 chore(NPM): Add license info 2013-04-11 15:32:19 -07:00
Prathan Thananart 6b63afe2f7 docs(guide): Update $locationProvider docs.
Default hashPrefix setting is not `'!'`, it's actually `""`.
Source: https://github.com/angular/angular.js/blob/master/src/ng/location.js#L472
2013-04-11 15:27:46 -07:00
kamagatos b86815fb5b docs(guide/i18n): fix a typo 2013-04-11 15:21:33 -07:00
winkler1 aa3acc5229 docs(animator): fix typo 2013-04-11 15:14:46 -07:00
Christoph Burgdorf 15d80af53c docs(jqLite): clarified that children/parent do not support selectors 2013-04-11 15:11:28 -07:00
Matt Haggard a92bb2e025 docs: fix typos 2013-04-11 15:03:59 -07:00
Brent Morrow d521ad3ff6 docs(ngApp): fixed typo
Use this directive to auto-bootstrap **an** application.
2013-04-11 14:58:39 -07:00
Brent Morrow ebf7cf9ed3 docs(guide/concepts): fix typo
An event is a user **interaction**, timer event, or network event (response from a server).
2013-04-11 14:56:30 -07:00
玉黍 719d844a94 docs(examples): set ng-app to "personalLog" (example/personalLog) 2013-04-11 14:53:40 -07:00
{Qingping,Dave} Hou db547e63ee docs(guide): Added $ sign to controller example 2013-04-11 14:32:44 -07:00
urenmj 63c25fd875 docs(dev-guide): Fixed a typo. 2013-04-11 14:25:50 -07:00
Matias Niemelä 1351ba2632 fix(ngAnimate): skip animation on first render 2013-04-11 14:15:20 -07:00
Matias Niemelä 5476cb6e9b feat($animator): allow to globally disable and enable animations 2013-04-11 14:15:20 -07:00
Artur Ostrega d9d53472ec docs(http): spelling, grammar, capitalization, etc. 2013-04-11 14:10:57 -07:00
Brent Morrow 38dffe7e91 docs(guide/concepts): wording change
... or when working with --> a <-- third-party library callbacks.
... or when working with third-party library callbacks.
2013-04-11 14:08:43 -07:00
Brent Morrow 941633a911 docs(guide/concepts): wording change 2013-04-11 14:07:31 -07:00
Brent Morrow 3ec7b87483 docs(guide/expression): wording changes 2013-04-11 14:03:52 -07:00
Luc Morin 63ce1f6265 docs(guide/directives): give more details about directive declaration 2013-04-11 14:00:09 -07:00
Colin Kahn 59eb96b9e4 docs(guide/filters): document multiple arguments syntax
Add example of using a filter with that accepts multiple arguments.
2013-04-11 13:55:03 -07:00
Brent Morrow e142687bcb docs(angular-mocks): fix wording 2013-04-11 13:51:40 -07:00
Brent Morrow 16bfb7eea0 docs($inject): wording change 2013-04-11 13:48:04 -07:00
David Sanders 48308913bb docs($compile): improve docs 2013-04-11 13:05:27 -07:00
Braden Shepherdson 5e0f876c39 feat(ngSwipe): Add ngSwipeRight/Left directives to ngMobile
These directives fire an event handler on a touch-and-drag or
click-and-drag to the left or right. Includes unit tests and docs
update. Manually tested on Chrome 26, IE8, Android Chrome and iOS
Safari.
2013-04-11 13:01:24 -07:00
Brian Campbell f24cf4b58f docs(guide): updates for legacy IE7 support
- note re: id="ng-app" to bootstrap/IE partials
- added doctype/xmlns to markup
- add cond comment re: json2/3 to markup
2013-04-11 13:00:10 -07:00
Igor Minar a752e5763e chore(release): start 1.1.5 triangle-squarification iteration 2013-04-11 12:51:47 -07:00
Chad Whitacre 725028b07d docs($http): fix a typo 2013-04-11 12:39:00 -07:00
Patrick f9b63f8657 docs(animator): Fixed a typo 2013-04-11 12:15:25 -07:00
Matias Niemelä be08c075bd fix($sniffer): $sniffer to support non-vendor prefixes 2013-04-08 21:26:19 -07:00
Heath Matlock d90a79632d docs(concespts): correct spelling and remove unnecessary word 2013-04-06 22:56:54 +02:00
Igor Minar cc042c42bc docs(changelog): fix the 1.0.6 header 2013-04-04 15:24:15 -07:00
Igor Minar 7729b58eda docs(changelog): add release notes for 1.1.4 and 1.0.6 2013-04-04 12:15:37 -07:00
Igor Minar 2ce74e547a docs($resource): improve installation section 2013-04-04 08:57:25 -07:00
Igor Minar 5e3ee0a99b chore(release): cutting angular 1.1.4 quantum-manipulation 2013-04-03 18:54:52 -07:00
William Bagayoko 308a59bf44 fix(ngAnimator): correct polyfillSetup activation and memento generation 2013-04-03 18:42:17 -07:00
Matias Niemelä 19f1801379 docs: add animations into docs and directive examples 2013-04-03 17:40:15 -07:00
Igor Minar 303df9dafe chore(karma): upgrade karma to 0.8.4
we needed this upgrade to disable animations in scenario runner
(karma ships with its own copy of angular-scenario.js which
got update in 0.8.4)
2013-04-03 17:40:15 -07:00
Igor Minar fec4ef3881 feat(Scenario): autodisable animations when running e2e tests
animations cause the dom to contain elements that have been removed
from the model but are being animated out.

we could teach the e2e runner to wait for animations but that would
make all tests slower. it should be quite safe to just disable
animations automatically when the app is running via the e2e test
runner.

this change disables only css animations. we should make additional
change that disables js animations as well, but since we don't need
this right now I'm punting on it.
2013-04-03 17:40:15 -07:00
Misko Hevery ecdf119a76 fix(ngShow/ngHide): revert to display:'' for show
Regression introduced by ngAnimation
SHA: 0b6f1ce5f8
2013-04-03 15:20:53 -07:00
Misko Hevery 820253f670 chore(revert): accidental inclusion of nonexistent test.
Offending SHA: 0b6f1ce5f8
2013-04-03 14:54:16 -07:00
Misko Hevery 6bca948323 chore(revert): Revert accidental change to showdown
Offending SHA: 0b6f1ce5f8
2013-04-03 14:35:09 -07:00
Igor Minar 556f9cc35e style(animator): style cleanup 2013-04-03 02:15:03 -07:00
Matias Niemelä 2845dd1590 feat(ngdocs): added functionality to import and extract contents of external files inside docs comment code 2013-04-02 15:52:32 -07:00
Misko Hevery 0b6f1ce5f8 feat(ngAnimate): add support for animation 2013-04-02 14:05:06 -07:00
Misko Hevery 4bfb66ce0b chore(docs): correct few unclosed elements 2013-04-02 13:36:12 -07:00
Igor Minar 85c31e0688 docs(ngSwitch): improve the @usage example 2013-04-01 21:33:31 -07:00
Vojta Jina c2e215fab6 chore: use Karma 2013-04-01 12:24:27 -07:00
Misko Hevery 61f2767ce6 feat(ngRepeat): add support for custom tracking of items
BREAKING CHANGE:

It is considered an error to have two items produce
the same track by key. (This was tolerated before.)
2013-03-29 23:01:52 -07:00
Matias Niemelä 5eb968553a feat(Scope): add $watchCollection method for observing collections
The new method allows to shallow watch collections (Arrays/Maps).
2013-03-29 22:00:25 -07:00
Felipe Lahti 04cc1d2890 docs(guide): add missing closing div tag 2013-03-29 23:30:37 +01:00
Felipe Lahti 7d4a3210f0 docs(guide): fix typo in DI. angualar -> angular 2013-03-29 23:25:58 +01:00
Gert Goet 8dca0561e8 docs(mocks): fix typos 2013-03-29 23:24:12 +01:00
Srinivas Kusunam 53abd3fba7 docs(directive): fix typo 2013-03-29 23:22:02 +01:00
Matthew McComb 06ada222c2 docs(controller): improve $controller function doc readability
Improved $controller function doc readability.
2013-03-29 23:18:01 +01:00
Pascal Borreli 9480136d9f docs(*): fixed typos 2013-03-29 23:14:55 +01:00
Sylvester Keil 4ae46814ff feat(http): support request/response promise chaining
myApp.factory('myAroundInterceptor', function($rootScope, $timeout) {
    return function(configPromise, responsePromise) {
        return {
            request: configPromise.then(function(config) {
                return config
            });
            response: responsePromise.then(function(response) {
                return 'ha!';
            }
        });
}

myApp.config(function($httpProvider){
    $httpProvider.aroundInterceptors.push('myAroundInterceptor');
});
2013-03-27 13:13:59 -07:00
Misko Hevery 5c735eb4ab fix(mock): prevent NPE when module definition outside of it. 2013-03-27 08:56:06 -07:00
James deBoer 364e597499 Update forms.ngdoc
docs(forms): Fixed a typo. render -> $render
2013-03-24 23:11:36 -07:00
Chirayu Krishnappa 23abb990f1 chore($ngLocale): refactor i18n closure slurper logic and parse extended datetime symbols 2013-03-20 16:19:46 -07:00
Chirayu Krishnappa 0c72708a2b chore($ngLocale): generate ngLocale files from the Closure code (includes datetimesymbolsext.js) 2013-03-20 15:50:07 -07:00
Jason Als fec2909f3a fix(ngMobile): Use bracket notation to fix minified version
Added aliases for minification
2013-03-20 14:21:26 -07:00
Mark Chapman 4efda14b49 refactor(ngRepeat): make use of declared variable
Rename unused arrayLength variable to arrayBound and use it inside loop
2013-03-20 14:16:41 -07:00
Arlen Christian Mart Cuss 821d2fddb7 chore(select): Fix ngOptions regexp capture comment.
Off-by-one error.
2013-03-20 11:44:17 -07:00
Javier Mendiara Cañardo ef76afdf80 chore(Angular): remove superfluous fromCharCode function
Remove fromCharCode function as it was used only in two inner
functions in the code, and its functionality is achieved in several
other places by using String.fromCharCode

Breaks fromCharCode closure function, String.fromCharCode should be
used instead
2013-03-19 11:00:42 -07:00
Bruno Coelho 564963dc27 docs(filter): Using indefinite article
This doc was using both definite article and indefinite article at the same time.
2013-03-19 10:56:48 -07:00
Arlen Christian Mart Cuss fe4f0ea262 docs(directive): Fix entity confusion in example. 2013-03-19 10:53:46 -07:00
Manuel Braun 3a81dd8bdd fix($location): parse FirefoxOS packaged app urls
FirefoxOS uses special URLs like
app://{d0419af1-8b42-41c5-96f4-ef4179e52315}/index.html for packaged Apps.

Closes #2112
2013-03-15 21:19:31 -07:00
Jamie Mason df9bff13b2 $routeChangeSuccess documentation
I hope this helps someone, I ran into some issues when following the API as described - handlers of this event receive 3 arguments, not 2.

Although this is mentioned [elsewhere](http://docs.angularjs.org/api/ng.$rootScope.Scope#$on) it's not clear when viewing the docs for this behaviour in isolation. 

The first argument is an Event Object, not the current route. The previous route argument can also be omitted on occasions.
2013-03-15 21:02:21 -07:00
Shyam Seshadri f197e391c1 feat(docs): Add Improve this doc link in each doc page, which links to the edit mode of that file in github 2013-03-15 20:56:13 -07:00
Sujeet Pillai 1c1cd4fdf6 fix(timezone): correct timezone date filter for 1/2 hour offsets 2013-03-14 22:16:54 -07:00
Shyam Seshadri 79049b9fee Fix failing test in IE 10 2013-03-14 22:03:37 -07:00
Igor Minar 9428338e97 chore(docs): add angular-mobile.js to index.html 2013-03-13 23:01:16 -07:00
Braden Shepherdson 707c65d5a2 feat(ngMobile): add ngMobile module with mobile-specific ngClick
Add a new module ngMobile, with mobile/touch-specific directives.
Add ngClick, which overrides the default ngClick. This ngClick uses touch
events, which are much faster on mobile. On desktop browsers, ngClick
responds to click events, so it can be used for portable sites.
2013-03-13 22:59:06 -07:00
Arlen Christian Mart Cuss d1b49e25f1 docs($injector): correct misuse of $inject
$inject was used where $injector was appropriate; confusing and
misleading.
2013-03-12 13:00:03 -07:00
Igor Minar 5fd39e050b chore(Gruntfile): run webserver on 0.0.0.0
... so that we can access it from local VMs.

The security risk of doing this is very low since only the current
working directory is being made accessible to everyone. There is also
an option to run a local firewall, which is a better way to secure the
developer's machine anyway.
2013-03-11 15:26:50 -07:00
Thibault Leruitte 9befe37014 fix($location): correctly rewrite html5 url to hashbang url
In situations where path() matched basepath and we needed to
convert from html5 url to hashbang url, the $location service
considered the url to be already rewritten, which resulted in
an error.
2013-03-11 15:26:38 -07:00
Lucas Galfasó e88d6179c3 feat(ng:switch): Preserve the order of the elements not in the ng-switch
Preserve the order of the elements that are not part of a case nor default in
a ng-switch directive

BREAKING CHANGE: elements not in the ng-switch were rendered after the
    ng-switch elements.  Now they are rendered in-place.

    Ng-switch directives should be updated with non ng-switch elements
    in render-order.  e.g.

    The following was previously rendered with <li>1</li> after "2":

    <ul ng-switch="select">
        <li>1</li>
        <li ng-switch-when="option">2</li>
    </ul>

    To keep the old behaviour, say:

    <ul ng-switch="select">
        <li ng-switch-when="1">2</li>
        <li>1</li>
    </ul>

Closes #1074
2013-03-11 11:31:04 -07:00
Christian Vuerings 90ba9aadc6 docs(ngCloak): update the CSS rule with data-ng-cloak 2013-03-08 17:23:04 -08:00
Chirayu Krishnappa 96b13bbee1 chore($ngLocale): Generate ngLocale files from the Closure code. 2013-03-08 15:46:59 -08:00
Jason Morrison a248d5a32d docs($injector): remove extranneous 'the' from injector docs 2013-03-08 23:44:44 +01:00
Niel de la Rouviere 69ef17cce9 docs(directive): minor typo fix
Changed "obeject" to "object"
2013-03-08 23:26:41 +01:00
Mark Nadig f20646bce5 feat(directive): add ngKeypress directive for handling keypress event 2013-03-08 21:56:32 +01:00
Igor Minar 65e57a7c3d test($route): add tests for matching 'otherwise' routes 2013-03-08 12:00:34 -08:00
Igor Minar 6f71e80914 fix($route): make nextRoute.$route private
the `nextRoute` object available in `$routeChangeStart` handler
accidentaly leaked  property which pointed to the route definition
currently being matched.

this was done just for the internal needs of the `$route` implementation
and was never documented as public api.

Some confusion arouse around why the $route property was not always
available on the `nextRoute` object (see #1907). The right thing for us
to do is to prefix the property with $$ for now and refactor the code
to remove the property completely in the future. Application developers
should use the `nextRoute` object itself rather than its `$route` property.
The main diff is that nextRoute inherits from the object referenced by $route.

BREAKING CHANGE: in $routeChangeStart event, nextRoute.$route property is gone.

Use the nextRoute object instead of nextRoute.$route.

Closes #1907
2013-03-08 12:00:34 -08:00
Ciro Nunes cb5ce981fb docs($resource): Added an installation section. 2013-03-08 11:04:32 -08:00
Alexander Shtuchkin 99f3b70b2d feat(http): set custom default cache in $http.defaults.cache
When we need more control over http caching, we may want to provide
a custom cache to be used in all http requests by default.

To skip default cache, set {cache: false} in request configuration.
To use other cache, set {cache: cache} as before.

See #2079
2013-03-08 10:19:18 -08:00
Julie 603fe0d196 feat(angular.bootstrap): support deferred bootstrap
This features enables tools like Batarang and test runners to
hook into angular's bootstrap process and sneak in more modules
into the DI registry which can replace or augment DI services for
the purpose of instrumentation or mocking out heavy dependencies.

If window.name contains prefix NG_DEFER_BOOTSTRAP! when
angular.bootstrap is called, the bootstrap process will be paused
until angular.resumeBootstrap is called.

angular.resumeBootstrap takes an optional array of modules that
should be added to the original list of modules that the app was
about to be bootstrapped with.
2013-03-06 16:19:35 -08:00
Dave Geddes 485f104099 docs(contribute): add note about running command line as admin on win 2013-03-06 14:54:35 -08:00
Igor Minar d38d8448e8 chore(Grunt): include dot files in the final zip 2013-03-06 14:51:21 -08:00
Dave Geddes 8a96393179 chore(Grunt): don't remove root dir from zip 2013-03-06 14:51:16 -08:00
Igor Minar 49128cc100 docs($http): add more info about transform function 2013-03-06 11:20:30 -08:00
Dave Geddes 79b51d5b57 chore(Grunt): switch from Rake to Grunt
Migrates the Angular project from Rake to Grunt.

Benefits:
- Drops Ruby dependency
- Lowers barrier to entry for contributions from JavaScript ninjas
- Simplifies the Angular project setup and build process
- Adopts industry-standard tools specific to JavaScript projects
- Support building angular.js on Windows platform (really?!? why?!?)

BREAKING CHANGE: Rake is completely replaced by Grunt. Below are the deprecated Rake tasks and their Grunt equivalents:

rake --> grunt
rake package --> grunt package
rake init --> N/A
rake clean --> grunt clean
rake concat_scenario --> grunt build:scenario
rake concat --> grunt build
rake concat_scenario --> grunt build:scenario
rake minify --> grunt minify
rake version --> grunt write:version
rake docs --> grunt docs
rake webserver --> grunt webserver
rake test --> grunt test
rake test:unit --> grunt test:unit
rake test:<jqlite|jquery|modules|e2e> --> grunt test:<jqlite|jquery|modules|end2end|e2e>
rake test[Firefox+Safari] --> grunt test --browsers Firefox,Safari
rake test[Safari] --> grunt test --browsers Safari
rake autotest --> grunt autotest

NOTES:
* For convenience grunt test:e2e starts a webserver for you, while grunt test:end2end doesn't.
  Use grunt test:end2end if you already have the webserver running.
* Removes duplicate entry for Describe.js in the angularScenario section of angularFiles.js
* Updates docs/src/gen-docs.js to use #done intead of the deprecated #end
* Uses grunt-contrib-connect instead of lib/nodeserver (removed)
* Removes nodeserver.sh, travis now uses grunt webserver
* Built and minified files are identical to Rake's output, with the exception of one less
  character for git revisions (using --short) and a couple minor whitespace differences

Closes #199
2013-03-05 23:00:33 -08:00
Thibault Leruitte fe8d893b83 feat($compile): allow directives to modify interpolated attributes
A directive can now set/update/remove attribute values even those containing
interpolation during the compile phase and have the new value be picked up
during the compilation.

For example in template:

<div replace-directive some-attr-or-directive="{{originalInterpolationValue}}"></div>

the replace-directive can now replace the value of some-attr-or-directive during compilation
which produces this intermitent template:

<div replace-directive some-attr-or-directive="{{replacedInterpolationValue}}"></div>

or even

<div replace-directive some-attr-or-directive="replacedStaticValue"></div>

as well as

<div replace-directive some-attr-or-directive></div>
2013-02-28 17:27:27 -08:00
Luis Ramón López eb53423a41 feat($compile): support for dynamic template generation
`template` and `templateUrl` properties can now be optionally defined
via a function. This allows templates to be dynamically generated on
the fly.
2013-02-27 17:57:59 -08:00
David Chang 5e18a15fb0 feat($route): add caseInsensitiveMatch option for url matching
with this property urls can be matched case-insensitively which
enables some new use cases.
2013-02-27 12:45:30 -08:00
zeflasher 60f1f099fc feat($resource): ability to override url in resource actions
Resources now can defined per action url override. The url is treated
as a template rather than a literal string, so fancy interpolations
are possible.

See attached tests for example usage.
2013-02-27 10:52:30 -08:00
Luis Ramón López cf17c6af47 feat($compile): add attribute binding support via ngAttr*
Sometimes is not desirable to use interpolation on attributes because
the user agent parses them before the interpolation takes place. I.e:

<svg>
  <circle cx="{{cx}}" cy="{{cy}}" r="{{r}}"></circle>
</svg>

The snippet throws three browser errors, one for each attribute.

For some attributes, AngularJS fixes that behaviour introducing special
directives like ng-href or ng-src.

This commit is a more general solution that allows prefixing any
attribute with "ng-attr-", "ng:attr:" or "ng_attr_"  so it will
be set only when the binding is done. The prefix is then removed.

Example usage:

<svg>
  <circle ng-attr-cx="{{cx}}" ng-attr-cy="{{cy}}" ng:attr-r="{{r}}"></circle>
</svg>

Closes #1050
Closes #1925
2013-02-27 00:55:40 -08:00
Andrew McLeod 86d191ed4a fix($http): don't encode URL query substring "null" to "+"
Fixes issue in encodeUriQuery used by $http and $resource that
treats null as a string and replaces the characters "null" with "+".
2013-02-26 17:25:15 -08:00
Matt Ginzton c38c1c5030 docs(ngMock): fix minor typo in comment
Change "constroctor" to "constructor".
2013-02-25 23:54:44 -08:00
Matt Ginzton d4fe383b7b docs(ngMock): remove Jasmine-only comments now that Mocha works
Remove comments about angular.mock.inject and angular.mock.module
being available for jasmine only. Since 1.1.1 the intent is that
they be available for mocha as well; now they even work!
2013-02-25 23:54:29 -08:00
Matt Ginzton 6397860831 fix(ngMock): fix isSpecRunning to work for Mocha
When running inside Mocha, don't look in Jasmine's spec.queue.running.
It's not there. This is documented as issue #1467; I think this issue was
also responsible for #1589 and recent complaints in #1253.

Closes #1467.
2013-02-25 23:52:12 -08:00
danilsomsikov 398691beb3 fix($compile): compile replace directives in external template
Passing DOMNode#childNodes to compileNodes when compiling remote
template, so that directives with replace:true can be compiled.
The previous version used jqLite#contents which returned collection
that was not updated during the compilation.

Closes #1859
2013-02-25 21:44:00 -08:00
Igor Minar 7ddbde8c1c chore(sortedHtml): print attributes with empty value
I had to also fix some tests as they started failing on IE8.

We should figure out why these extra attributes are set in IE8,
but I'm too tired of IE to worry about it now. Since I'm
not introducing this issue just making it visible, I'm going
to commit this as is.
2013-02-25 21:38:29 -08:00
Jørgen Borgesen 753fc9e58d feat(JQLite): ready() now supports document.readyState=='complete'
JQLite.ready() used for automatic bootstrapping (when jQuery is not present)
now checks if document already is ready when first called. This simplifies
bootstrapping when the angular script is loaded asynchronously.

However if other scripts with angular app code are being loaded as well
it is developers responsibility to ensure that these scripts are loaded
after angular-loader.js is evaluated and before angular.js script is
evaluated.
2013-02-25 15:32:14 -08:00
Vineet Kumar 6a612df7de docs(guide/directives): update obsolete doc reference
Replace an obsolete reference to a nonexistent "Creating Widgets"
section with a real link to "Creating Components".
2013-02-25 14:51:52 -08:00
Luis Ramón López ac899d0da5 feat($compile): '=?' makes '=' binding optional
If you bind using '=' to a non-existant parent property, the compiler
will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception, which is right
because the model doesn't exist.

This enhancement allow to specify that a binding is optional so it
won't complain if the parent property is not defined. In order to mantain
backward compability, the new behaviour must be specified using '=?' instead
of '='. The local property will be undefined is these cases.

Closes #909
Closes #1435
2013-02-25 14:30:54 -08:00
Pawel Kozlowski 30162b769c docs(dateFilter): properly specify range for the Z format modifier
Closes #1533
2013-02-25 13:51:13 -08:00
Alexander Shtuchkin 7d18d0ae26 refactor($route): use $q#all hash signature 2 simplify 'resolve' impl 2013-02-25 10:58:10 -08:00
Alexander Shtuchkin e27bb6eb13 feat($q): $q.all() now accepts hash
When waiting for several promises at once, it is often desirable to
have them by name, not just by index in array.

Example of this kind of interface already implemented would be a
$routeProvider.when(url, {resolve: <hash of promises>}), where
resources/promises are given by names, and then results accessed
by names in controller.
2013-02-25 10:58:05 -08:00
Igor Minar 7b236b29aa fix($compile): whitelist file:// in url sanitization 2013-02-25 10:02:28 -08:00
Steven Davidson c36933d38f chore(nodeserver): fix log message for 301 response 2013-02-23 23:44:40 -08:00
Igor Minar bec614fd90 fix($compile): handle elements with no childNodes property
see the test for more details
2013-02-23 23:22:14 -08:00
Igor Minar 509ec745fd fix($httpBackend): prevent DOM err due to dereferencing .responseText
If responseType is defined and the request fails for one reason or another
the .response property returned falsy value which caused dereferencing of
.responseText. If the responseType was a blob or document then an error
was thrown.

To prevent this, I'm checking for responseType first and based on that
dereferencing .response or .responseText.

We need to keep on checking .responseText because that's the original XHR
response api that is still needed for IE8 and 9.

Closes #1922
2013-02-23 22:16:41 -08:00
Igor Minar d44ca19da7 chore(release): start 1.1.4 quantum-manipulation iteration 2013-02-23 21:11:51 -08:00
Igor Minar 2508b47c1a docs(changelog): fix release notes 2013-02-20 15:44:19 -08:00
Igor Minar de6d4ca1da chore(release): cut 1.1.3 radioactive-gargle release 2013-02-20 12:54:44 -08:00
Igor Minar 776dfc678b docs(changelog): add release notes for 1.0.5 and 1.1.3 2013-02-20 11:16:19 -08:00
Igor Minar 9532234bf1 fix($compile): sanitize values bound to a[href] 2013-02-20 00:06:26 -08:00
Per Rovegård 5f5d4feadb fix(ngClass): keep track of old ngClass value manually
ngClassWatchAction, when called as a $watch function, gets the wrong old
value after it has been invoked previously due to observation of the
interpolated class attribute. As a result it doesn't remove classes
properly. Keeping track of the old value manually seems to fix this.

Closes #1637
2013-02-18 20:25:43 -08:00
Pete Bacon Darwin 791804bdbf fix(compile): should not leak memory when there are top level empty text nodes
The change to prevent <span> elements being wrapped around empty text nodes caused these empty text nodes to have scopes and controllers attached, through jqLite.data() calls, which led to memory leaks and errors in IE8.
Now we exclude all but document nodes and elements from having jqLite.data() set both in the compiler and in ng-view.

Fixes: #1968 and #1876
2013-02-18 12:05:16 +00:00
Luis Ramón López 7eafbb98c6 feat(routeProvider): Add support to catch-all parameters in routes
This allows routeProvider to accept parameters that matches
substrings even when they contain slashes if they are prefixed
with an asterisk instead of a colon.
For example, routes like edit/color/:color/largecode/*largecode
will match with something like this
http://appdomain.com/edit/color/brown/largecode/code/with/slashs.
2013-02-14 21:36:59 -08:00
Pete Bacon Darwin bb8448c011 fix(compile): Initialize interpolated attributes before directive linking 2013-02-14 21:36:59 -08:00
Pete Bacon Darwin 2ed53087d7 fix(compile): Interpolate @ locals before the link function runs
Do a one-off interpolation of @ locals to ensure that the link fn receives attributes that are already interpolated.
2013-02-14 21:36:59 -08:00
Lucas Galfasó 0af172040e feat(ngSwitch): support multiple matches on ngSwitchWhen and ngSwitchDefault
Closes #1074
2013-02-14 19:55:05 -08:00
Will Moore e19b04c9ec fix($httpBackend): patch for Firefox bug w/ CORS and response headers
A workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=608735
In FF getAllResponseHeaders() returns null if the request is the result of CORS.

Tried to format the code so that when a FF patch is released and gains enough
traction it can easily be selected and deleted. Heavily inspired by jQuery's
patch for the same bug. This patch falls short of passing through custom headers
but covers all of the "simple response headers" in the spec at
http://www.w3.org/TR/cors/

This commit should get reverted once Firefox 21 gets out.

Closes #1468
2013-02-14 16:45:30 -08:00
Igor Minar 37e8b12265 fix(a): workaround IE bug affecting mailto urls
Apparently there is a really weird bug in IE6-8 that causes anchor textContent
to be reset with href content when both contain @ symbol.

Inserting a bogus comment node into all anchor elements in IE works around this
browser bug.

I'm fixing the issue via directive because that way we'll fix it for jQuery as
well.

I fixed an e2e test too because it was incorrect.

Closes #1949
2013-02-14 16:42:58 -08:00
Igor Minar 1ace5eb396 style(filter): remove ws 2013-02-14 16:38:43 -08:00
Igor Minar 3c2aee01b0 fix(*): don't use instanceof to detect arrays
this breaks when multiple javascript contexts are involved - like in node-webkit

see original PR: #1966

Closes #1966
2013-02-14 16:37:00 -08:00
Cedric Soulas 37bdcc984a docs($resource): fix bad indentation producing a code block 2013-02-14 15:47:16 -08:00
Ewen Cumming 027f20be1f docs($rootScope): rearrange event listener docs 2013-02-14 15:47:16 -08:00
deboer 9b7c1d0f7c fix(ngSwitch): make ngSwitch compatible with controller BC module
add a $scope to the ngSwitch's controller to fool the controller
BC (backwards compatibility) module used by DFA.
2013-02-14 15:36:03 -08:00
Vineet Kumar 5548328b67 docs($q): fix a few typos 2013-02-14 15:18:58 -08:00
Dylan Pyle 7c6b1e06e8 docs(guide): fix some invalid javascript in directive documentation
Use double quotes to maintain consistency with other HTML
2013-02-14 15:11:04 -08:00
Vojta Jina 288b69a314 fix($http): do not encode special characters @$:, in params
encodeURIComponent is too aggressive and doesn't follow http://www.ietf.org/rfc/rfc3986.txt
with regards to the character set (pchar) allowed in path segments so we need
this test to make sure that we don't over-encode the params and break stuff
like buzz api which uses @self.

This is has already been fixed in `$resource`. This commit fixes it in a same way
for `$http` as well.

BREAKING CHANGE: $http does follow RFC3986 and does not encode special characters
like `$@,:` in params. If your application needs to encode these characters, encode
them manually, before sending the request.
2013-02-14 14:52:46 -08:00
Mark Nadig 2a2123441c fix($resource): params should expand array values properly
Today, calling e.g. var R = $resource('/Path/:a'); R.get({a: 'foo', bar: ['baz1', 'baz2']}); results in a query
string like "/Path/doh?bar=baz1,baz2" which is undesirable. This commit enhances resource to use
$http to encode any non-url parameters resulting in a query string like "/Path/doh?bar=baz1&bar=baz2".

BREAKING CHANGE: if the server relied on the buggy behavior then either the
backend should be fixed or a simple serialization of the array should be done
on the client before calling the resource service.
2013-02-14 14:52:46 -08:00
Daniel Luz 1d7a95df56 feat(scope): only evaluate constant $watch expressions once 2013-02-14 14:43:56 -08:00
Daniel Luz 1ed638582d feat($parse): added constant and literal properties
* `literal` is set to true if the expression's top-level is a JavaScript
  literal (number, string, boolean, null/undefined, array, object), even
  if it contains non-literals inside.

* `constant` is set to true if the expression is known to be made
  entirely of constant values, i.e., evaluating it will always yield the
  same result.

A consequence is that a JSON expression is guaranteed to be both literal
and constant.
2013-02-14 14:43:56 -08:00
Daniel Luz 3b14092135 docs($parse): document function argument types, fix minor typo 2013-02-14 14:43:56 -08:00
Daniel Luz ef268196b9 fix($rootScope): minor typo fixes 2013-02-14 14:43:56 -08:00
James Morrin 12ba6cec4f feat(noConflict): restore previous angular namespace reference 2013-02-14 14:43:55 -08:00
Fredrik Bonander b7e1fb0515 fix(resource): Update RegExp to allow urlParams with out leading slash
Will allow reoucese to be loaded from a relative path
Example:
var R = $resource(':path');
R.get({ path : 'data.json' });

Example usage:
Load resources in applications not using webserver, ie local webapp in 
on a tablet.
2013-02-14 14:43:55 -08:00
Shyam Seshadri 755beb2b66 fix(compiler): Allow startingTag method to handle text / comment nodes 2013-02-14 14:43:55 -08:00
Trotter Cashion 6d70ff5c8d chore(reakefile): auto install npm packages 2013-02-14 14:43:55 -08:00
Rosina Bignall ace54ff08c feat(filter): Add comparison function to filter
Add optional comparator function argument to $filter('filter')(array,
expression, comparator) such that the comparator function is used to
compare the values and predicates.  When true, defaults to equality.
When missing defaults to substring matching.
2013-02-14 14:43:55 -08:00
Kury Kruitbosch f5835963d5 fix(numberFilter): fix formatting when "0" passed as fractionSize
When checking to add decimal and trialing 0s number filter used to check
trueness of fractionSize. "0" evaluating to true causes "123" to return "123."
2013-02-14 13:15:50 -08:00
Jesse Cooke f3231b9447 docs(guide): Fix typos in concepts/model,view. 2013-02-14 13:05:25 -08:00
Igor Minar a8a3efb5f0 chore(Rakefile): parallelize the build on Travis
now that the forking issue is solved we can run regular build there

https://github.com/travis-ci/travis-ci/issues/845
2013-02-14 12:46:19 -08:00
Cedric Soulas e47f8d2b96 docs($resource): fix missing punctuation 2013-02-14 11:57:33 -08:00
Igor Minar dba6bc73e8 feat($resource): expose promise based api via $then and $resolved
Expose $then and $resolved properties on resource action return values which
allow checking if a promise has been resolved already as well as registering
listeners at any time of the resource object life-cycle.

This commit replaces unreleased commit f3bff27460
which exposed unintuitive $q api instead and didn't expose important stuff
like http headers.
2013-02-11 22:24:21 -08:00
Igor Minar c0a0781425 chore(matchers): fix hasBeenCalledOnceWith matcher
the error message was wrong and misleading
2013-02-11 22:13:15 -08:00
Igor Minar 035e0130f3 test(angular.copy): add tests for scenarios when target is missing 2013-02-11 22:11:07 -08:00
Igor Minar 9e57ce0c7a revert: refactor(angular.copy): use slice(0) to clone arrays
This reverts commit 28273b7f1ef52e46d5bc23c41bc7a1492cf23014o.

slice(0) doesn't perform deep copy of the array so its unsuitable
for our purposes.
2013-02-11 21:58:00 -08:00
Igor Minar 42a5033c56 chore(docs): improve docs parser type
previously we barfed on function type definition with optional arguments
like {function(number=)}

this fixes it

I also added a bunch of code that helps to debug incorrectly parsed docs.
2013-02-11 14:08:16 -08:00
Igor Minar 6b19e7d527 refactor(angular.copy): use array.length=0 to empty arrays 2013-02-11 14:07:49 -08:00
Igor Minar 28273b7f1e refactor(angular.copy): use slice(0) to clone arrays
slice(0) is way faster on most browsers
2013-02-11 14:07:03 -08:00
Igor Minar ec54712ff3 fix(angular.forEach): correctly iterate over objects with length prop
Should handle JQLite, jQuery, NodeList and other objects like arrays
but not other generic objects or instances of user defined types
with length property.

Closes #1840
2013-02-11 12:29:55 -08:00
radu 23dd78f8a4 docs($q): fix typos 2013-02-07 04:16:16 -08:00
Julie d46fe3c23f fix(scenario): include error messages in XML output
Fix the XML output of scenario tests so that it properly includes error
messages from failing specs.
2013-02-07 04:09:52 -08:00
Enrique Paredes 92ca7efaa4 fix($compile): rename $compileNote to compileNode
Directives was observing different instances of Attributes than the one
that interpolation was registered with because we failed to realize
that the compile node and link node were the same (one of them
was a wrapper rather than raw node)

Closes #1941
2013-02-07 02:49:12 -08:00
Fredrik Bonander 7090924515 fix($cookies): set cookies on Safari&IE when base[href] is undefined
Safari and IE don't like being told to store cookies with path set to
undefined. This change ensures that if base[href] (from which cookie path
is derived) is undefined then the cookie path defaults to ''.

The test verifies that the cookie is set instead of checking that cookie has correct path,
this is due to that cookie meta information is not avabile once the cookie is set.

Closes #1190, #1191
2013-02-07 02:36:25 -08:00
Maxim Grach df744f3af4 feat(dateFilter): add [.,]sss formatter for milliseconds
Also Implement getMilliseconds() method of TzDate and
add test for this in ngMock.
2013-02-07 02:28:33 -08:00
Sam McCall 8155c3a29e feat($http): allow overriding the XSRF header and cookie name
Add 'xsrfCookieName' and 'xsrfHeaderName' property to $httpProvider.defaults and
http config object, which give the name of the cookie the XSRF token is found
in, and the name of the header it is sent in, respectively.
This allows interop with servers with built-in XSRF support that use different
names.
The defaults match the current hard-coded values of 'XSRF-TOKEN' and
'X-XSRF-TOKEN'.
2013-02-07 01:48:01 -08:00
Philip Roberts b001c8ece5 fix(date): invert timezone sign and always display sign
This commit fixes #1261 and #1532. This covers
two separate issues:

- Positive timezones were being formatted without
a leading `+` resulting in a formatting string
like: "HH:MM:ssZ" giving "12:13:141000" instead
of "12:13:14+1000". Fixed by checking if timezone
is > 0 and adding a leading "+".

- Timezone output signs were inverted.
mock.TzDate expects the timezone _offset_ as it's
first argument, _not_ the timezone. This means
that a mock.TzDate with a positive offset should
result in a date string with a negative timezone,
and vice-versa.

Closes #1261, #1532
2013-02-07 01:32:04 -08:00
Igor Minar bec4435945 docs(guide): remove stale info about filters changing DOM
as of v0.10.6 this is not the case any more
2013-02-06 14:14:49 -08:00
Thomas Schultz 6fb1054ce6 docs(tutorial): remove extra back-tick character 2013-02-06 21:51:42 +01:00
theotheo a83eced974 docs(module): fix code example 2013-02-06 20:40:06 +01:00
radu 7cc4063303 docs(ngApp): fix typo 2013-02-05 21:29:11 +01:00
Igor Minar d8e242418d docs(contributing): add CLA anchor for deeplinking 2013-02-04 09:38:01 -08:00
PowerKiKi 6518369f25 docs(ngClass): fix typo in description 2013-02-04 10:36:29 +00:00
Brian Ford 649b892205 feat(Scope): expose transcluded and isolate scope info for batarang
test($compile): add test for exposing transclude and isolate scope info to batarang
2013-01-30 10:42:56 -05:00
Dean Sofer e0295cfec4 docs($cookies): added example to $cookies api docs
Better than nothing.
2013-01-29 16:16:17 -08:00
radu 17fc6a70fe docs(nextUid): fix typo
Update src/Angular.js

removed redundant 'the' from nextUid()'s ngdoc
2013-01-29 15:49:10 -08:00
radu 5d0f9ce4c7 docs(tutorial): fix typo
Update docs/content/tutorial/step_00.ngdoc

removed redundant verb
2013-01-29 15:46:32 -08:00
Fred Sauer 250aec71f3 docs(Scope): fix argument docs for $on 2013-01-29 15:38:19 -08:00
metaweta 3b317c5dcb test(ngBindHtml): prevent variable name leak
Add "var" so element is local instead of global

Strict mode doesn't allow undeclared global vars, and these really should be local anyway.
2013-01-29 13:26:06 -08:00
metaweta e4cfb9d938 refactor(Angular.js): prevent Error variable name leak in tests
Remove var Error = window.Error

window.Error is a read-only property in Apps Script.

Igor says, "we should just delete that line instead. I think it was
misko's attempt to get better closure minification, but it turns out
that it's actually hurting us after gzip (I verified it)."
2013-01-29 13:24:33 -08:00
Igor Minar 87ba8221ec chore(release): start 1.1.3 radioactive-gargle iteration 2013-01-29 13:20:43 -08:00
Fred Sauer e34519e93b docs(a): escape sample code in ng a directive 2013-01-26 22:52:16 +01:00
Igor Minar 69be39fccf fix(docs): properly generate angular.js urls in doc examples 2013-01-24 11:36:03 -08:00
Igor Minar deac80a6e8 docs(date): add missing doc about TZ behavior 2013-01-24 10:51:03 -08:00
Igor Minar 0539611bac docs(changelog): correct 1.0.4 release notes 2013-01-24 09:50:27 -08:00
Vineet Kumar d2177ae312 docs($injector): clarify $inject property description
Section heading about `$inject` property refers to it as `$injector` property.
2013-01-24 00:15:32 -05:00
Partap Davis f3bff27460 feat(resource): add $q/$resorved property to Resource 2013-01-23 20:57:26 -08:00
Igor Minar 4df45b20d4 chore(release): update the CDN version 2013-01-23 12:06:40 -08:00
Igor Minar 5745734991 chore(release): cut 1.1.2 tofu-animation release 2013-01-23 10:54:35 -08:00
Igor Minar 0551aa95f0 docs(changelog): release notes for 1.1.2 and 1.0.4 2013-01-22 22:58:55 -08:00
Igor Minar b62327ec2d docs(ngOpen): fix typo in api docs 2013-01-22 22:58:55 -08:00
Igor Minar 07a58dd766 chore(changelog.js): improve the changelog script 2013-01-22 22:49:00 -08:00
Igor Minar ffe5e01584 revert: fix($resource): Route constructor, updated RegExp
This reverts commit 06ed8ef012.

The reverted commit causes regressions. See comments in the PR:
https://github.com/angular/angular.js/pull/1402#issuecomment-12575399
2013-01-22 16:32:02 -08:00
Igor Minar 3c2e1c5e4d fix(angular.equals): relax the comparison for undefined properties
in 5ae63fd3 the comparison was made consistent but strict, so that

angular.equals({}, {foo: undefined}) // always returns false

this turns out to cause issues for data that is being roundtripped via network
and serialized via JSON because JSON.stringify serializes {foo: undefined} as {}.

Since angular.equals() behaved like this before the 5ae63fd3 in 50% of the cases,
changing the behavior in this way should not introduce any significant issues.

Closes #1648
2013-01-22 07:35:21 -08:00
Igor Minar cdf7781878 chore(Rakefile): skip build parallelization on Travis
Due to a infrastructure change on Travis starting JVMs in forked
processes doesn't currently work. Since we don't really care that
much about the build speed on Travis, I'm going to disable it there.

Related issue: https://github.com/travis-ci/travis-ci/issues/845
2013-01-21 07:50:16 -08:00
sergiopantoja 7e8d3c1736 docs(jqLite): fix typo 2013-01-20 18:39:21 +01:00
Will Moore d30845a757 docs(contribute): adding npm install to step-by-step
npm install is listed in the dependencies section of the contribute guide but
is missing from the step-by-step. This adds it as step 4.
2013-01-18 21:33:10 -08:00
Fredrik Bonander 06ed8ef012 fix($resource): Route constructor, updated RegExp
Update RegExp to allow urlParams with out leading slash (/).
- Will allow reoucese to be loaded from a relative path

Example:
var R = $resource(':path');
R.get({ path : 'data.json' });

Example usage:
Load resources in applications not using webserver, ie local webapp in on a tablet.
2013-01-18 21:28:15 -08:00
Pedro Del Gallego 2f437e8978 feat(scenario): add mouseover method to the ngScenario dsl 2013-01-18 21:24:57 -08:00
Luis Ramón López faf02f0c4d feat(route): Allow using functions as template params in 'when' 2013-01-18 21:20:49 -08:00
David Chang b8bd4d5460 feat(directive): added ng-open boolean directive
Closes# 1797 add ng-open attribute
2013-01-18 21:16:16 -08:00
pavelgj b2f46251ac fix(ngResource): correct leading slash removal.
Fixed an issues with ngResource param substitution where it was incorrectly removing leading slash when param was followed by a non-slash character.
Ex:
'/:foo/:bar.baz/:aux'

params = {
  foo: 'aaa',
  bar: undefined,
  aux: undefined
}

The above params were incorrectly producing '/aaa.baz' but now it results in '/aaa/.baz'.
2013-01-18 20:52:57 -08:00
danilsomsikov a26234f718 fix(ngSwitch): don't leak when destroyed while not attached
The leak can occur when ngSwich is used inside ngRepeat or any other
directive which is destroyed while its transcluded content (which
includes ngSwitch) is not attached to the DOM.

Refactor ngSwitch to use controller instead of storing data on compile
node. This means that we don't need to clean up the jq data cache.
Controller reference is released when the linking fn is released.

Closes #1621
2013-01-18 00:03:28 -08:00
Misko Hevery 61315211da fix(git-validator): support fixup and better errors 2013-01-17 23:52:46 -08:00
Misko Hevery af89daf464 feat(ngResource): support all $http.config actions
This allows the transformation of the $http request in both directions,
headers, caching, and timeout.
2013-01-17 23:08:39 -08:00
Fred Sauer 224d7d6e90 docs(exceptionHandler): document testing
Update src/ng/exceptionHandler.js

Here's an iniitla attempt at documenting how one might write a
test using $exceptionHandlerProvider. The key take-away is the use
of this pattern:

it(...

 module(...
   $exceptionHandlerProvider.mode('log');
 });

 inject(...
 );

});
2013-01-17 23:08:39 -08:00
Jeremy Tymes a179a9a96e feat($parse): allow strict equality in angular expressions
Allows the parser to parse strict equality and inequality
in angular expressions.

Closes #908
2013-01-17 23:08:38 -08:00
Matthew Browne 610a5a0c14 docs(rootScope): correct code examples 2013-01-17 23:08:38 -08:00
Amir H. Hajizamani 4f5583465a docs(cookbook): change prototype methods to scope methods in Buzz
As explained in 'Understanding the Controller Component', Controllers
written for new (post 1.0 RC) versions of Angular need to add methods to
the scope directly, not the function's prototype. Correcting this
example should remove any ambiguity, especially for beginners.
2013-01-18 00:49:41 -05:00
Amir H. Hajizamani 75487ec933 docs(guide): change prototype methods to scope methods in DI examples
As explained in 'Understanding the Controller Component', Controllers
written for new (post 1.0 RC) versions of Angular need to add methods to
the scope directly, not the function's prototype. Correcting this
example should remove any ambiguity, especially for beginners.
2013-01-18 00:49:41 -05:00
Fred Sauer dddb1221fa docs(ngMock.$httpBackend): fix variable declaration 2013-01-18 00:13:39 -05:00
Shai Reznik 69e4d40a76 doc(guide): Fixed typos at the unit tests guide 2013-01-17 23:43:13 -05:00
Shai Reznik d521619c58 doc(guide): Fix examples of $location.html5mode 2013-01-17 23:43:13 -05:00
Igor Minar 5ae63fd385 fix(angular.equals): consistently compare undefined object props
previously:

a = {};
b = {x:undefined};
angular.equals(a, b) == angular.equals(b, a) // returns false.

both should return false because these objects are not equal.

unlike in implemented in #1695 the comparison should be stricter
and return false not true. if we need to relax this in the future
we can always do so.

Closes #1648
2013-01-17 17:48:51 -08:00
Daniel Demmel 8b44324814 docs: recommend using Google CDN 2013-01-17 16:52:05 -08:00
nlaplante 9e991ddb1d feat($log): add $log.debug()
New debug() method with suppressable output via
$logProvider.debugEnabled()

Closes #1592
2013-01-17 16:47:39 -08:00
Matt Rohrer 93070f1488 docs(guide): minor grammar fixes 2013-01-17 19:10:46 -05:00
Gergely Imreh 3c8583e5dd chore(Rakefile): force 32bit JVM mode only when java supports it
Some Java installs don't have '-d32' flag (e.g. OpenJDK which is standard
for some Linux systems), and the closure_compile fails because of forcing
that flag. Test, and only run in faster 32bit mode if supported, or
else just run with no flag (default mode).
2013-01-17 01:34:01 -08:00
Igor Minar 78699c62ea chore(docs): use done() instead of end() in gen-docs.js 2013-01-17 00:51:56 -08:00
Pete Bacon Darwin 49f9e4cef1 fix($compile): do not wrap empty root text nodes in spans
Closes #1059
2013-01-17 00:28:44 -08:00
Pete Bacon Darwin 7e746015ea fix(ngRepeat): correctly apply $last if repeating over object
If the $last property is calculated from the original collectionLength
on an object and properties starting with $ were filtered out, then $last
is never applied and $middle is applied erroniously.

Closes #1789
2013-01-17 00:25:30 -08:00
James deBoer 8c269883fd chore(Rakefile): remove a duplicate file in angularFiles.js 2013-01-16 23:45:09 -08:00
James deBoer a69674b36d chore(Rakefile): generate version.json
Changes 'rake version' to output a version.json file which
contains the structured version info which can be used in other tools.
2013-01-16 23:41:45 -08:00
Igor Minar 8b9e6c3501 fix(scenario): don't trigger input events on IE9
input.enter() should trigger 'change' rather than 'input' event on IE9 because
input events on IE9 are broken and angular doesn't rely on them
2013-01-16 23:26:36 -08:00
Kanwei Li c97c53dbd4 docs(CHANGELOG): fix typo 2013-01-16 21:55:06 +01:00
Martin Probst c6392616ea fix($route): support route params not separated with slashes.
Commit 773ac4a broke support for route parameters that are not seperated
from other route parts by slashes, which this change fixes. It also adds
some documentation about path parameters to the when() method and
escapes all regular expression special characters in the URL, not just
some.
2013-01-16 09:41:02 -08:00
Igor Minar 74dd2f7980 fix($compile): safely create transclude comment nodes
Closes #1740
2013-01-14 21:57:23 -08:00
Lucas Galfasó c0cb9f8c14 doc(directive): Fix typos in dialog widget
Fixes #1799
2013-01-13 10:08:19 +00:00
Igor Minar 7dff7bb696 chore(*): remove obsolete files 2013-01-09 21:28:53 -08:00
Martin Probst cdf6fb19c8 feat($compile): support modifying the DOM structure in postlink fn
Support modifying the DOM structure in the post link function of a directive
by creating a defensive copy of the node list, as opposed to a live DOM list.
This is useful for directives to actually replace their entire DOM fragment,
e.g. with the HTML fragment generated by a 3rd party component (Closure, Bootstrap ...).
Fix the indentation of the compileNodes function (was one too little).
2013-01-09 20:06:22 -08:00
Igor Minar c909f49112 style($compile): fix indentation 2013-01-09 16:54:29 -08:00
Igor Minar cc821502bc fix(date): parse string input as local time unless TZ is specified
previously we were always parsing the string input as UTC which cased issues like:

{{ '2012-04-01' | date:'d MMM yyyy' }} renders as 31 Mar 2012

BREAKING CHANGE: string input without timezone info is now parsed as local time/date

Closes #847
2013-01-09 09:50:43 -08:00
naomiblack 037aefae47 Update docs/content/misc/faq.ngdoc
Updated the canonical video to a recent one. Fixed a typo.
2013-01-09 09:49:44 +00:00
Pete Bacon Darwin febb4c1c35 fix(jqLite): children() should only return elements
The jQuery implementation of children only returns child nodes of the given element that are elements themselves. The previous jqLite implementation was returning all nodes except those that are text nodes. Use jQLite.contents() to get all the child nodes.

The jQuery implementation of contents returns [] if the object has no child nodes.  The previous jqLite implementation was returning undefined, causing a stack overflow in test/testabilityPatch.js when it tried to `cleanup()` a window object.

The testabilityPatch was incorrectly using children() rather than contents() inside cleanup() to iterate down through all the child nodes of the element to clean up.
2013-01-09 09:22:35 +00:00
Keyamoon 76a6047af6 fix(jqLite): make next() ignore non-element nodes
next() is supposed to return the next sibling *element* so it
should ignore text nodes. To achieve this, nextElementSibling()
should be used instead of nextSibling().
2013-01-08 14:54:15 -08:00
Igor Minar b6b7c5a1d6 fix($injector): remove bogus fn arg
getService fn takes only one argument, removing the second one.

Closes #1711
2013-01-08 14:36:03 -08:00
Igor Minar 5b5f35d5e4 refactor($browser): remove faulty 20+ cookies warning
the warning is defunct (and the test is incorrect) so obviously nobody is using
it and it just takes up space.

also the browser behavior varies (ff and chrome allow up to 150 cookies, safari
even more), so it's not very useful.

Closes #1712
2013-01-08 14:23:50 -08:00
Igor Minar 14948cf5d9 revert: fix(a): prevent Opera from incorrectly navigating on link click
This reverts commit c81d8176cc.

This commit causes several issues (#1651, #1674, #1662) and doesn't even
contain a test that proves that anything on Opera got actually fixed.

If the original Opera resurfaces, we'll fix it properly.
2013-01-08 11:47:22 -08:00
kim lokoy 2b0978b07c docs(guide): fix typos in unit test guide 2013-01-07 21:01:01 +01:00
Pawel Kozlowski 1122dc7a5b docs(forms): fix code example for a custom form control
Closes #1021
2013-01-05 22:47:36 +01:00
naomiblack a3a9d4af05 docs(faq): add info on logo reuse and how to get t-shirts and stickers 2013-01-04 18:59:11 +01:00
Jonathan Card 36089931a5 docs(form): minor form doc and example fixes
Form documentation fixes:
- Fix broken form example in docs
- A few small other corrections in form docs.
2013-01-04 09:28:35 +01:00
Per Rovegård 74db36ee94 docs($http): clarify documentation on error status codes
Modify the documentation for $http to correspond to what Angular
considers a success status code.

Closes #1693
2013-01-03 20:49:43 +01:00
Matt Hardy 8d42ce8563 docs(guide): change example controller to properly call greet method on greeter 2012-12-31 12:49:51 +01:00
petrovalex f0c6ebc076 feat($timeout-mock): add verifyNoPendingTasks method
added verifyNoPendingTasks method, which throws error if not all
deferred tasks have been flushed

Closes #1245
2012-12-20 20:39:40 +01:00
Murilo da Silva 59d9b89852 docs(anchorScroll): correct word "location" 2012-12-19 21:01:41 +01:00
John Fletcher 6aac69039e docs(guide): minor English corrections to the Directive guide 2012-12-19 20:35:31 +01:00
Jeremy Tymes 9e96d98345 feat(limitTo): limitTo filter accepts strings
This allows strings to be filtered by limitTo, using the same methods

Closes #653
2012-12-19 20:13:36 +01:00
Miško Hevery 1e13544da8 docs(directive): old syntax 2012-12-18 20:38:43 -08:00
Mark Nadig e03182f018 feat(directive): ng:keydown, ng:keyup
New directives for binding to keydown and keyup events.

Closes #1035
2012-12-18 22:57:58 +01:00
Pawel Kozlowski f2d526190a docs(ngView): fix code example (change template to templateUrl)
Closes #1715
2012-12-17 23:18:12 +01:00
Miško Hevery 039b138042 docs(q): added testing information 2012-12-14 05:49:22 -08:00
Gonzalo Ruiz de Villa 30a9da5dc1 fix($route): correctly extract $routeParams from urls
Routes like '/bar/foovalue/barvalue' matching '/bar/:foo/:bar'
now are well mapped in $routeParams to:
{bar:'barvalue', foo:'foovalue'}

Closes: #1501
Signed-off-by: Gonzalo Ruiz de Villa <gonzaloruizdevilla@gmail.com>
2012-12-14 01:15:15 +01:00
ggoodman 25e1ad9a94 feat(docs): Add angularjs tag to plunks and make private
This is a minor edit to allow Plunks created by way of the docs.angularjs.org site to be appropriately tagged as `angularjs`.
Also, make these generated Plunks private by default.
2012-12-11 19:04:46 +00:00
Peter Evjan 37cced6296 docs(README.md): add missing 'you' and a comma 2012-12-11 19:20:30 +01:00
Romain Neutron a66c968df2 docs(guide): fix injector service code example
Fix syntax and update code to the latest API
2012-12-10 23:19:20 +01:00
Juha Syrjälä c398d7d370 docs($resource): document port number escaping and fix typo
Closes #1243
2012-12-09 17:13:29 +01:00
Eric Case d93533812b docs(tutorial): typo fix commandx -> command 2012-12-08 11:33:07 +01:00
Eric Case ff11061a8f docs($q): typo fix - programing -> programming 2012-12-07 20:45:33 +01:00
János Rusiczki c52bfd37ee doc(concepts): Fix typo in $render() function 2012-12-07 10:03:58 +00:00
Jeremy Tymes f8b755982a docs($http): fix link typo in $http doc
Should be $httpBackend instead of $httpBacked

Closes #1516
2012-12-06 21:25:47 +01:00
Fred Sauer bcc7089b3c docs(mocks): update src/ngMock/angular-mocks.js documentation
Clarify how to use `$exceptionHandlerProvider.mode('log')` in tests
2012-12-06 21:18:49 +01:00
Fred Sauer d43cc3f893 docs(mocks): fix documentation bug: angular.mock.debug 2012-12-06 21:13:51 +01:00
Igor Minar c9d937082c chore(bootstrap-prettify): update urls to code.angularjs.org
Closes #1599
2012-12-05 02:55:43 +01:00
_pants 26adeb119b fix(select): support optgroup + select[multiple] combo
Closes #1553
2012-12-05 02:20:11 +01:00
Stephane Bisson 15183f3e1f feat(e2eRunner): fail when an option to select does not exist 2012-12-01 20:05:42 +01:00
Sudhir Jonathan 2c405f4171 fix($injector): provider can now be defined in the array format
`injector.instantiate` is now called for arrays too, instead of only for functions.

Closes #1452
2012-12-01 18:41:59 +01:00
Sudhir Jonathan 8991680d8a fix($resource): HTTP method should be case-insensitive
Perform call `angular.uppercase` on all given action methods.

Closes #1403
2012-11-30 22:58:11 +01:00
Cezar Berea ec801ac137 refactor($resource): fix indentation and move a method definition
Moved Resource.bind out of the actions forEach
2012-11-30 22:35:57 +01:00
Igor Minar d6da505f4e fix(Scope): ensure that a scope is destroyed only once
Due to bd524fc4 calling $destroy() on a scope mupltiple times cases NPE.

Closes #1627
2012-11-30 13:10:00 +01:00
Daniel Luz 5f7054bf5d docs(directive): correct expression, fix typo and re-wrap lines 2012-11-29 19:40:33 +01:00
Johannes Hansen cf4ed8a145 fix(docs): add missing </div> tag to sourceEdit directive template 2012-11-29 19:40:30 +01:00
Igor Minar d1e48fcbf3 docs(menu): fix the navbar drop down links 2012-11-28 23:56:09 +01:00
Pascal Corpet cc42c99bec feat($resource): allow dynamic default parameters
Default resource params can now be calculated at runtime if defined
via a function.
2012-11-28 16:01:57 +01:00
Igor Minar 3c7bfa77aa chore(release): start 1.1.2 tofu-animation iteration 2012-11-28 14:21:33 +01:00
Igor Minar 2ee0f56c54 chore(release): cutting the 1.1.1 pathological-kerning release 2012-11-27 01:45:35 +01:00
Igor Minar 9b18644f30 docs(CHANGELOG): release notes for 1.0.3 and 1.1.1 releases 2012-11-27 01:43:05 +01:00
Rado Kirov fce100a46c fix($http): only set X-XSFR-TOKEN header for same-domain request
This is needed to prevent CORS preflight checks. The XSFR token
is quite useless for CORS requests anyway.

BREAKING CHANGE: X-XSFR-TOKEN is no longer send for cross domain
requests. This shouldn't affect any known production service.

Closes #1096
2012-11-26 23:58:59 +01:00
Rado Kirov 3a75b1124d fix($http): remove 'X-Requested-With' from header defaults
X-Requested-With header is rarely used in practice and by using
it all the time we are triggering preflight checks for crossdomain
requests.

We could try detecting if we are doing CORS requests or not, but
it doesn't look like it's worth the trouble.

BREAKING CHANGE: X-Requested-With header is not set by $http service
any more. If anyone actually uses this header it's quite easy to add
it back via:

```
myAppModule.config(['$httpProvider', function($httpProvider) {
    $httpProvider.defaults.headers.common["X-Requested-With"] = 'XMLHttpRequest';
}]);
```

Closes #1004
2012-11-26 23:36:40 +01:00
Rado Kirov a32bc40fd7 fix($location): reset $location.$$replace with every watch call
Closes #1111
2012-11-26 23:21:02 +01:00
Igor Minar cfe13b5dac chore(validate-commit-msg): recognize 'revert' as valid commit type 2012-11-26 21:05:38 +01:00
Igor Minar d859dcecea fix(ngClassOdd/ngClassEven): support shrinking/reordering in repeaters
We need to watch $index in addition to cssClasses because only then
we can correctly respond to shrinking or reordered repeaters.

Closes #1076
2012-11-26 20:36:53 +01:00
Igor Minar d3b32a7c94 style(jqLite): better variable names
selector => cssClasses
2012-11-26 20:36:53 +01:00
Igor Minar 1b17dfa693 fix(ngRepeat): support mostly-stable repeating for primitives
I'm reverting changes that were originally done to ngRepeat to fix #933,
because these are now not necessary after the previous changes to keep
ngModel always synced with the DOM.
2012-11-26 20:36:53 +01:00
Igor Minar e6d9bea4f3 fix(ngModel): sync ngModel state with scope state
In cases when we reuse elements in a repeater but associate
them with a new scope (see #933 - repeating over array of
primitives) it's possible for the internal ngModel state and
the scope state to get out of sync. This change ensure that
the two are always sync-ed up even in cases where we
reassociate an element with a different (but similar) scope.

In the case of repeating over array of primitives it's still
possible to run into issue if we iterate over primitives and
use form controls or similar widgets without ngModel - oh well,
we'd likely need a special repeater for primitives to deal
with this properly, even then there might be cornercases.

Closes #933
2012-11-26 20:36:53 +01:00
Igor Minar c8e9105fe6 test(ngRepeat): clean up and improve tests 2012-11-26 20:36:52 +01:00
Igor Minar d644dcfa52 fix(ngRepeat): attempt to simplify and improve existing fix for #933
I'm keeping this in for future reference. The issue with this solution
is that if we shift() the first item in the array, the whole repeater
DOM will be rebuilt from scratch, we need to do better than that.
2012-11-26 20:31:54 +01:00
Igor Minar e7d37ee45a test(ngRepeat): add test for issue #1076 2012-11-26 20:17:11 +01:00
Pawel Kozlowski 733a97adf8 feat(form): add ability to reset a form to pristine state
Retting a form to pristine state will cause all of the nested
form and form controls to be recursively reset as well.

Closes #856
2012-11-26 16:44:34 +01:00
Igor Minar 96ed9ff59a fix(jqLite): support append on document fragment
previously jquery didn't support append on this node type, now it does
(since 1.8.x) so I'm adding this to jqlite as well.
2012-11-26 15:45:04 +01:00
Igor Minar b9a9f91fbf fix(jqLite): fire $destroy event via triggerHandler
in jQuery 1.8.x the data() data structure is changed and events are
not accessible via data().events. Since all we need is to trigger
all event handlers, we can do so via triggerHandler() api instead of
mocking with the internal jQuery data structures.

This fix was originally proposed by PeteAppleton via PR #1512.

Closes #1512
2012-11-26 15:45:04 +01:00
Igor Minar 650fd933df feat(jqLite): add triggerHandler()
we need triggerHandler() to become jQuery 1.8.x compatible.

this is not fully featured triggerHandler() implementation - it doesn't
bother creating new DOM events and passing them into the event handlers.

this is intentional, we don't need access to the native DOM event for our
own purposes and creating these event objects is really tricky.
2012-11-26 15:45:04 +01:00
Igor Minar e249502880 chore(jquery): upgrade to jquery 1.8.2 2012-11-26 15:45:04 +01:00
Iristyle ca3e0e7374 docs(CONTRIBUTING.md): add contrib info file for GitHub 2012-11-25 21:00:14 +01:00
Vojta Jina e6966e05f5 fix(Scope): allow removing a listener during event 2012-11-25 11:39:54 +01:00
Kevin Western 682418f029 docs(README.md): fix "API Docs" link
use direct link to api docs
2012-11-25 01:21:52 +01:00
Dean Sofer c8fd7fd0e2 docs(api): add ngRequired to input/select/textarea directives
Closes #1202
2012-11-25 01:18:10 +01:00
JP Sugarbroad 168db33985 feat($cacheFactory): cache.put now returns the added value
This allows common programming patterns to be expressed with more
concise code.

See #1583 for code examples.
2012-11-25 00:01:34 +01:00
Tom Davis 79af2badcb fix($http): config.param should expand array values properly
Today, calling e.g. $http(url, { params: { a: [1,2,3] } }) results in a query
string like "?a=%5B1%2C2%2C3%5D" which is undesirable. This commit enhances
buildURL to createa query string like "?a=1&a=2&a=3".

BREAKING CHANGE: if the server relied on the buggy behavior then either the
backend should be fixed or a simple serialization of the array should be done
on the client before calling the $http service.

Closes #1363
2012-11-24 22:26:23 +01:00
Zach Dexter 610927d77b feat(linky): allow optional 'target' argument
Closes #1443
2012-11-24 22:21:50 +01:00
Jeremy Tymes 55d15806fb fix($cacheFactory): return undefined when removing non-existent entry
Instead of throwning an exception, remove should return undefined when
cache entry to be removed doesn't exist.

Closes #1497
2012-11-24 21:56:28 +01:00
Adrian Gheorghe 94e1c0391c fix($resource): prevent default params to be shared between actions
Having a $resource defined as:

var R = $resource('/Path', {}, {
  get: {method: 'GET', params: {objId: '1'}},
  perform: {method: 'GET'}
});

was causing both actions to call the same URI (if called in this order):

R.get({}); // => /Path?objId=1
R.perform({}); // => /Path?objId=1
2012-11-24 21:27:24 +01:00
Kris Jenkins b21f4a376d docs(): Fix a couple of typos in the documentation 2012-11-21 23:06:59 +01:00
Dave Clayton f28f283fcf docs(guide/concepts): some typo/grammar fixes 2012-11-17 23:55:32 +01:00
John Hume e362a510e3 docs(guide/directive): fix typo 2012-11-17 23:49:19 +01:00
Uri Goldshtein 8a7f752a80 docs($q): fix missing bracket in the example 2012-11-17 23:45:08 +01:00
Igor Minar af7e0bd0a7 fix(CSP): update to the latest CSP api
window.SecurityPolicy.isActive() is now window.securityPolicy.isActive

since this is available only in Chrome Canary which has already been
updated, we can safely make this change without worrying about
backwards compatilibty.

Closes #1577
2012-11-15 01:46:58 +01:00
Igor Minar bd524fc4e5 fix($rootScope): workaround for Chrome's memleak
Under certain circumstances chrome fails to GC scopes
because of buggy optimizations and caching. Nulling out
references to (not from!) other scopes helps Chrome to
realize that this object should be GC-ed.

This is really just a workaround as the real problem needs
to be fixed in Chrome.

See discusstion at:
https://github.com/angular/angular.js/issues/1313#issuecomment-10378451

And chrome bug at:
https://code.google.com/p/v8/issues/detail?id=2073

Closes #1313
2012-11-14 19:56:28 +01:00
Haralan Dobrev 19a324ce11 docs(angular.module): improve angular.Module#run docs 2012-11-11 11:40:18 +01:00
Jamison Dance cd8b78ebfd docs(guide): fix run-on sentence in modules guide 2012-11-11 11:34:06 +01:00
Jamison Dance 8891757891 docs(tutorial): change module name in step-7 2012-11-11 11:34:06 +01:00
Wes Alvaro 5c5193946d docs($timeout): set return type to Promise instead of *.
The cancel function accepts a Promise, but the timeout function
fails to specify returning a Promise.
2012-11-11 11:31:51 +01:00
Josh Adams ffa6c5195f docs(ngList): fix typo 2012-11-11 11:24:59 +01:00
Josh Adams a758799c7f docs(encodeUriSegment): fix typo 2012-11-11 11:22:43 +01:00
Tim Macfarlane e9253a88b9 docs(guide/directive): fix names in scope '='; easier to grok 2012-11-11 11:20:24 +01:00
Christian Vuerings f3e053cb6f docs(ngHide): Fix typo and make it more in line with ngShow 2012-11-11 10:36:28 +01:00
Anna Vester 04450c48df feat($sanitize): support telephone links
Per http://www.ietf.org/rfc/rfc3966.txt support tel: links
2012-11-11 10:31:27 +01:00
Igor Minar 8650843603 chore(docs): fix docs-scenario.html 2012-11-11 10:31:27 +01:00
Igor Minar e034fa08a8 chore(docs): remove obsolete gae files 2012-11-11 10:31:27 +01:00
Miško Hevery c6b4ab3548 Update docs/content/guide/directive.ngdoc
docs(directive): fix typo
2012-11-05 19:34:20 -08:00
Sudhir Jonathan b429f538a3 chore(testacular): use local testacular version
Making testacular a dependency to avoid having to install it globally.
(Causes npm issues on some machines)
2012-10-31 16:47:28 -07:00
Sudhir Jonathan b3cae4f457 fix(select): select option with a label of 0 is not shown
Bug caused by the use of the `||` operator to replace all non-truthy
values with an empty string. Changed to replace only `undefined` values.

Closes #1401
2012-10-31 15:03:13 -07:00
Igor Minar 7b52a976e1 chore(validate-commit-msg): allow '/' in scope 2012-10-31 14:47:59 -07:00
Fred Sauer 3a624a7ff5 docs(guide/location): fix table formatting
Fix table formatting so headings are bold, rows are separated by lines, and rows have :hover style
2012-10-31 14:47:53 -07:00
Tim Macfarlane b32adb7dea docs(module): fix typo in example
fixed example app, `simpleAppModule` should have been `myAppModule`.
2012-10-31 14:21:28 -07:00
sqwishy trick 271d2bed3a chore(injector): fix typo in injector documentation 2012-10-31 14:19:05 -07:00
Adam Macejak 249a1d84e7 fix(scenario-runner): support data-ng and x-ng based attributes
Prefixed attributes like data-ng-model and x-ng-model were not being
found by the Selector. It was only looking at ng: and ng- prefixed
attributes.
Added a few tests as well to ensure the aforementioned prefixed
attributes are being matched properly.

Closes #1020
2012-10-31 13:58:13 -07:00
Daniel Luz fdf85bfd86 docs(contribute): fix task name for continuous testing 2012-10-31 13:12:49 -07:00
Igor Minar 090e5426ac fix(docs): correctly generate filenames for plunkr/fiddle
previously examples like $http where broken because we would strip part of the
filename (http-hello.html -> http)

we really want to strip only the id suffix that we append to disambiguate
common filenames (like index.html) which appear in many examples.
2012-10-31 13:03:50 -07:00
Shyam Seshadri 7c67b2fb6a feat(docs): add plunkr support
Add option to edit source in Angular Docs in Plunkr in addition to JsFiddle
2012-10-31 12:54:52 -07:00
Daniel Luz 3c9b39ff52 fix(doc): typo on FAQ
Closes #1493
2012-10-31 10:24:12 -07:00
Igor Minar 54b3875ba5 fix($compile): don't look for class directives in empty string
if className is undefined or empty string, don't bother looking for directives in there
2012-10-29 17:49:56 -07:00
Igor Minar 008a782bc8 fix($compile): compilation should not recurse into empty nodes
if a node doesn't have children then don't try to compile these non-existent children
2012-10-29 17:49:36 -07:00
Igor Minar 524c5c8b5d style($compile): better fn names for debugging 2012-10-29 17:46:44 -07:00
Igor Minar b936236fbc refactor(): simplify nodeLinkFn 2012-10-29 17:46:44 -07:00
Igor Minar fc115bfd0d fix($compile): prevent double attr interpolation w/ templateUrl
This fixes the issue that caused two attr interpolation observers
to be registered for the same attribute as a result of isolate
scope definition with attr (@) property for this attribute.

Duplicate observers would then fight with each other updating the
model.

The issue occured only when this directive was used in a repeater
because that's when we clone the template node which caused the
two observers to point to two different sets of $attr instances.

Closes #1166, #836
2012-10-29 17:46:44 -07:00
Braden Shepherdson bca1604c12 fix(currency): Handle not-quite-zero values
IEEE 754 floating point sometimes results in values that are very small,
rather than zero. One example is 1.0 + 1.07 - 2.07, which returns
4.440892098500626e-16 instead of 0.

This change tweaks the number formatting logic so that an exponential
value with a negative exponent that is larger than the precision+1
returns 0 instead. For example: with precision 2, anything with an
exponent of -4, -5 or more would become 0. 9e-3 = 0.009 = 0.01, but 9e-4
= 0.0009 = 0.001 = 0.00. This detail is unlikely to matter since this
quirk is usually only triggered with values very close to zero.

Closes #1469
2012-10-26 08:51:28 -07:00
Braden Shepherdson f4517b500c doc(faq): Add Common Pitfalls section
Describes several common pitfalls new users of Angular fall into that
I've observed in #angularjs.
2012-10-26 08:49:44 -07:00
Braden Shepherdson f54edbbdd4 doc(faq): Fix minor spelling and wording errors 2012-10-26 08:49:44 -07:00
Igor Minar be50e0769a chore(check-size.sh): fix rake target 2012-10-22 12:39:37 -07:00
Igor Minar cf78fb5661 docs(contribute): add CLA note to code submission section 2012-10-19 09:14:05 -07:00
Igor Minar 5c9eb75867 docs(contribute): add visible link to github project 2012-10-19 09:02:06 -07:00
Igor Minar f43cf3b816 chore(jstd-scenario-adapter): remove from our repo
since we don't need the adapter for JsTD (testacular contains its own),
I'm removing this dead code.
2012-10-18 03:26:51 -07:00
Igor Minar 175e727f05 chore(validate-commit-msg): allow * and - in scope string 2012-10-18 03:26:08 -07:00
Igor Minar d938983c06 chore(jasmine): remove Jasmine from our repo
it's bundled with Testacular, so we don't need it here
2012-10-18 03:14:27 -07:00
Igor Minar 8d69f4b93a chore(jstd): remove JsTestDriver from our repo
Testacular FTW!
2012-10-18 03:13:04 -07:00
Igor Minar ca96ec32f9 docs(tutorial): replace JsTD with Testacular + drop snapshots
JsTD references have been replaced with Testacular stuff.

snapshots are PITA to maintain so I'm dropping them, everyone loves the Git
version anyway.
2012-10-18 02:33:45 -07:00
Igor Minar 4f59022582 chore(Rakefile): remove test_out dir when cleaning 2012-10-17 15:44:18 -07:00
Igor Minar 3bd95dbb1a chore(Rakefile): tune JVM for closure compiler
Using the client VM and forcing 32bit mode gives us huge perf boost.

before:

reali   0m8.173s
user    0m39.984s
sys     0m1.408s

after:

real    0m3.000s
user    0m12.687s
sys     0m0.852s
2012-10-17 15:36:51 -07:00
Igor Minar c959fa4fe8 chore(Rakefile): paralelize closure compilation
this speeds up the build by paralelizing closure compilation (the slowest
piece of the build process)

before:

real  0m14.372s
user  0m31.649s
sys   0m1.006s

after:

real  0m8.191s
user  0m40.473s
sys   0m1.378s
2012-10-17 14:38:15 -07:00
Vojta Jina a5d434d857 chore(test): add junit config for testacular 2012-10-17 13:17:16 -07:00
Igor Minar 0ae0591f42 chore(Rakefile): misc_options should support + -> , conversion 2012-10-17 12:48:08 -07:00
Igor Minar 43ac783d35 chore(Rakefile): use exec for webserver
exec unlike system replaces the current process. this way when we kill
the webserver process we don't get scary looking 'rake aborted' error
2012-10-17 12:45:10 -07:00
Misko Hevery c96dc60594 fix(doc): disable directory listing in docs.angularjs.org 2012-10-05 16:43:01 -07:00
Igor Minar b440ad36f3 docs(downloading): update the downloading docs 2012-10-05 03:13:51 -07:00
Vojta Jina 8b2532cec7 chore: add travis config 2012-09-24 23:39:33 -07:00
Vojta Jina 8db47ca7d4 fix($compile): reference local in isolate scope
This was really corner case:
Watcher needs to return changed value, to notify that model might have changed and one more $digest cycle needs to be performed.

The watcher, that takes care of reference binding into an isolate scope ("="), did not return changed value, if the change was from the isolate scope to the parent.

If any other watcher returned change, it worked fine, as this change caused re-digest.

Closes #1272
2012-09-20 18:32:01 -07:00
Vojta Jina bcaa3bb373 docs: load angular from CDN only on production
So that when running the docs locally, eg. during e2e testing, we use the latest build version of angular, rather than the stable one from CDN.

This fixes e2e tests running with Testacular.
2012-09-17 18:08:16 -07:00
Igor Minar 6fc4fdb438 docs(README): update README.md with new rake tasks 2012-09-17 14:51:21 -07:00
Igor Minar 6a5f8c0483 chore(Rakefile): fix test:jquery task 2012-09-17 14:50:51 -07:00
Igor Minar 20c116d9d5 docs(contribute): update contribute docs 2012-09-16 10:40:44 -07:00
Igor Minar 4a04c2ec0c chore(): remove unused files 2012-09-16 10:39:43 -07:00
Igor Minar 89dd566277 docs(contribute): update misc/contribute docs with Testacular info 2012-09-15 08:11:53 -07:00
Igor Minar 9d168f058f chore(testing): Testacular config files + rake tasks
- adds testacular config files for jqlite, jquery, modules and e2e tests
- replaces obsolete JsTD Rake tasks with Testacular onces
- rake tasks are parameterazied so that they can be used locally as well as on CI server

usage:

rake test  # run all tests on Chrome
rake test[Safari+Chrome+Opera]  # run all tests on Safari, Chrome and Opera
rake test[Safari]  # run all tests on Safari
rake test:jqlite # run unit tests using jqlite on Chrome
rake test:jqlite[Safari,"--reporter=dots"]  # run jqlite-based unit tests on Safari with dots reporter
rake autotest:jquery  # start testacular with jquery-based config and watch fs for changes
rake test:e2e # run end to end tests
2012-09-13 16:23:18 -07:00
Miško Hevery 5418564f04 docs(directive): remove reference to old isolation syntax 2012-09-13 11:31:06 -07:00
Misko Hevery b0a05a7531 fix($route): support inline annotation on .resolve 2012-09-11 22:10:26 -07:00
Tom Hughes 209b67df6a feat($http): Allow setting withCredentials on defaults
Closes #1095.
2012-09-11 21:59:31 -07:00
Vojta Jina 2e1539356a chore(scripts): add init-repo script 2012-09-11 17:27:57 -07:00
Misko Hevery 331cd5a8cb fix($evalAsync): have only one global async queue
Having one async queue per scope complicates the matters when users wish to do
partial scope updates, since many services put events on the rootScope. By
having single queue the programing model is simplified.
2012-09-11 16:12:41 -07:00
Brian Ford f2ebfa16b0 docs(guide): fix directive interpolation example code
Closes #1339
2012-09-11 16:12:41 -07:00
Shyam Seshadri 95276a7e10 fix(scenario): emit RunnerBegin event 2012-09-11 16:12:41 -07:00
Vojta Jina 5dbd942bac chore(scripts): add commit-msg hook (validation) 2012-09-11 16:12:40 -07:00
Jimmy Zhuo 84c13d96ff fix(scenario): NPE when no angular loaded in test page 2012-09-11 16:12:40 -07:00
Daniel Luz 79941d2527 docs($rootScope): fix iteration limit described by $watch, it's actually 10 as of now 2012-09-11 15:11:02 -07:00
Daniel Luz 03ebecd5eb docs($rootScope): fix typos and minor wording tweaks on $watch 2012-09-11 15:11:02 -07:00
Daniel Luz 62bb728d07 docs($rootScope): fix quoting on expression 2012-09-11 15:11:02 -07:00
Daniel Luz b8eb843b25 docs($rootScope): standardize on present, third-person actions for descriptions 2012-09-11 15:11:02 -07:00
Daniel Luz 053247e412 docs($rootScope): backquote attribute types too on $on 2012-09-11 15:11:02 -07:00
Daniel Luz 7fa391c979 docs($cacheFactory): fix backquotes on method descriptions 2012-09-11 15:11:01 -07:00
Daniel Luz b01c28c900 docs($rootScope): fix typos on $new 2012-09-11 15:11:01 -07:00
Daniel Luz c0b9e94dec docs($rootScope): fix typo on $eval 2012-09-11 15:11:01 -07:00
Daniel Luz 83fbdd1097 docs($rootScope): fix typos on $watch 2012-09-11 15:11:01 -07:00
Jay Zeng 03042c52b9 docs(ngResource): Spelling typo (agressive => aggressive) 2012-09-11 15:08:55 -07:00
Igor Minar 2a4a8226d1 fix($resource): fix isDefined -> angular.isDefined 2012-09-10 14:49:22 -07:00
sgtpep c81d8176cc fix(a): prevent Opera from incorrectly navigating on link click
we handle the navigation by ourselves, so we need to prevent the default action.

Opera ignores event.preventDefault() call so we must return false.
2012-09-06 16:06:27 -07:00
Kai Groner 04329151d2 fix(FormController): propagate dirty state to parent forms 2012-09-06 16:06:26 -07:00
Jonathan Zacsh a9be003fce chore(docs): get correct location for jasmine-node 2012-09-06 16:06:25 -07:00
Shyam Seshadri ca30fce28c fix(*): name all anonymous watch functions in Angular
This will allow us to see function names in Batarang and debugger.

Closes #1119
2012-09-06 16:06:25 -07:00
Xiangru Chen b6e4a71166 fix(ngSrc): don't set src if value is empty string
Current implementation of ngSrc may lead to empty src attribute when page is loading.

For example:

<img ng-src="{{image.url}}">
can be temporarily rendered as

<img src="">
before the image resource is loaded.

Some browser emits a request to the current page when seeing <img src=""> (Firefox13 and IE8 will, Chromium20 won't), which leads to performance problems.
2012-09-06 16:06:24 -07:00
Misko Hevery d9eff86ef7 fix($injector): more conservative annotation parsing 2012-09-06 16:06:24 -07:00
Pedro Del Gallego 8cb9c99ec0 feat(scenario): add dblclick method to the ngScenario dsl 2012-09-06 16:06:24 -07:00
Iwein Fuld 9473780e77 fix(dateFilter): make timezone optional
Makes the time zone optional in the date filter

Problem with the current R_ISO8601_STR regex was that the time was optional, but the zone was not.
This results in the filter not formatting local date times, which it could easily do.

For example:
2012-08-30 -> formatted
2012-08-30T06:06:06.123Z -> formatted
2012-08-30T06:06:06.123 -> NOT formatted

A simple change in the regex fixes this. Arguably this is closer to the ISO8601 spec which specifies
local dates being in the "current time zone" and not requiring a Z. In any case it behaves more like
a user would expect.
2012-09-06 16:06:23 -07:00
Misko Hevery eb5fd400d3 docs(concept): correct example for creating injector 2012-09-06 16:06:23 -07:00
Godmar Back 0472c5f07e docs(module): fixed module example and corrected typos 2012-09-06 16:06:23 -07:00
Cameron Westland 92558fe411 feat(mocha): support mocha in angular mocks 2012-09-06 16:06:23 -07:00
Gregory Pike d519953a4b feat(ngModel): support ngTrim attribute on input 2012-09-06 16:06:23 -07:00
Benjamín Eidelman 4909d1d39d fix($resource): allow falsy values in URL parameters
Close #1212

when a param value was 0 (or false) it was ignored and removed from url.
after this fix that only happens if the value is undefined or null.
2012-09-06 16:06:22 -07:00
Jay Zeng 7079ff5eb6 docs(module): myAppModule -> simpleAppModule 2012-09-06 16:06:22 -07:00
petrovalex 10e1c759f4 fix($resource): ignore undefined parameters
- $resource should handle multiple params with same name
- ignore slashes of undefined parameters
- fix default parameters issue, mentioned in #875

Closes #875
Closes #782
2012-09-06 16:06:22 -07:00
petrovalex 6c67719dfa fix(ngClassEven/Odd): filtering/ordering and repeater
Closes #1076
2012-09-06 16:06:22 -07:00
Max Martinsson cebd015f78 fix(ngClass): works with class interpolation
Closes #1016
2012-09-06 16:06:21 -07:00
Max Martinsson fbdab513dd feat($resource): support custom headers per action
Closes #736
2012-09-06 16:06:21 -07:00
Zhenbo Zhang f2b7fffdc0 fix(ngRepeat): now works with primitive types
closes #933
2012-09-06 16:06:21 -07:00
petrovalex 42c38b29f7 fix($parser): string concatination with undefined model
Closes #988
2012-09-06 16:06:21 -07:00
Stein Jakob Nordbø f299fd5122 fix(dateFilter): support sub-second precision on dateFilter 2012-09-06 16:06:19 -07:00
Igor Minar 05c88b866b docs($route): rename leftover $afterRouteChange to $routeChangeSuccess 2012-09-06 15:03:35 -07:00
Igor Minar 9b08bfa251 chore(release): prepare 1.1.1 pathological-kerning iteration 2012-09-06 10:41:23 -07:00
Misko Hevery 99a000bac2 fix(docs): broken url to angular-bootstrap 2012-09-04 18:15:00 -07:00
Igor Minar f353fea042 chore(Rakefile): add 'version' rake task to generate version.txt 2012-09-04 16:38:01 -07:00
Igor Minar b1f50307b3 chore(docs): bump up the stable version 2012-09-04 16:31:57 -07:00
Igor Minar d0c0eadedd chore(release): cut the 1.1.0 increase-gravatar release 2012-09-04 11:11:09 -07:00
Igor Minar b8fac353f0 chore(docs): don't rewrite colons in doc filenames 2012-09-04 11:11:09 -07:00
Igor Minar b22308152f chore(Rakefile): zip only the build dir 2012-08-31 13:59:03 -07:00
Igor Minar 5e9041818b revert: fix(ng-repeat) to work with primitive types
this was accidentaly merged in. the commit is not ready yet
and we don't have CLA signature.

This reverts commit 98d489712e.
2012-08-31 13:59:03 -07:00
Igor Minar db861db1f2 docs(changelog): release notes for 1.0.2 and 1.1.0 releases 2012-08-31 13:59:03 -07:00
Jonathan Zacsh b12d1b6813 fix(docs): Making sure gen_docs.sh looks for a globally installed copy of jasmine-node as well as local. 2012-08-30 22:33:30 -07:00
Fernando Correia acb499f820 docs(tutorial): correct typos and clarify a few sections 2012-08-30 22:19:34 -07:00
Brice Burgess 9a710c788d fix(docs): indicate support for passing a string as the controller property on $routeProvider's route object 2012-08-30 22:13:20 -07:00
brettcannon 1b34c6d558 doc(misc) Mention how attribute names map to directive names. 2012-08-30 22:09:16 -07:00
Igor Minar a62c7b8b4e test(locationSpec): fix broken tests after vojta's commit 2012-08-30 16:25:23 -07:00
Sahat Yalkabov 62cfedbe0c doc(module) changed simpleApp to myApp in the Module page guide for consistency 2012-08-30 16:10:39 -07:00
Steve Nicolai 5cb7297a08 doc(devguide) - Fix typos and small grammatical errors in the developer guide. 2012-08-30 16:02:24 -07:00
Igor Minar 0f05516d14 chore(docs): ask GAE to serve docs-keywords.js 2012-08-30 15:58:55 -07:00
Uri Goldshtein f5f1200f25 Loading from Google CDN
As you guys had mansion, we can and need to do it through Google CDN for better performance,
so i've updated it accordingly
2012-08-30 15:49:11 -07:00
Tyson Benson c023c850c3 docs(typos): fix typos in dev guide 2012-08-30 15:43:58 -07:00
German Galvis 5318588d6e fix(scenario): Adding meta tag to avoid cache issues 2012-08-30 15:36:42 -07:00
phil 14c8f6a7ca docs(api): fix typo on home page
Refference -> Reference
2012-08-30 15:31:29 -07:00
csugden 351deb555f Update docs/content/guide/overview.ngdoc
Corrects video information
2012-08-30 15:28:15 -07:00
Jamie Krug 847d2da0f8 fix(docs): Fix typos and improve grammar. 2012-08-30 15:25:21 -07:00
Jamie Krug dbefd671e4 fix(docs): Fix bad links. 2012-08-30 15:25:20 -07:00
Colin Frei aff68a9ddf docs(module) fix typo 2012-08-30 15:22:08 -07:00
Zhenbo Zhang 0a71753ce3 fix(ng-repeat) to work with primitive types 2012-08-30 15:20:40 -07:00
Vojta Jina 1a8642aac2 fix(mocks): free up memory after every spec 2012-08-30 15:18:09 -07:00
Igor Minar 8114d55a15 test(bootstrap): test exception siling during bootstrap
Closes #1018
2012-08-30 15:15:11 -07:00
Igor Minar 9398040a41 test(ngApp): add missing test for [ng-app] bootstrap 2012-08-30 15:15:11 -07:00
Brian Ford d804bbcd51 feat($interpolate): provide contextual error messages
if an exception occurs during interpolation of a string
(e.g. name() in "Hello, {{name()}}!" throws an exception) we now print
an error message with the expression that was being evaluated when the
exception was thrown.
2012-08-30 14:50:22 -07:00
Igor Minar d3fa7a2e9e fix(jqLite): better support for xhtml
it turns out that some stuff doesn't work in xhtml as it does in html.

for example &nbsp; can't be innerHTML-ed and auto-closing of elements
doesn't work.

the reporter of the referenced issue claimed that innerHTML vs text on
script made a difference but that doesn't appear to be true in my testing.

I'm not including test for this because testacular doesn't currently
run tests in xhtml yet.

Closes #1301
2012-08-30 10:53:23 -07:00
Igor Minar 8693eac417 chore(docs): correctly link docs images 2012-08-30 02:26:35 -07:00
Igor Minar e0184d4aef chore(Rakefile): fix the default task 2012-08-29 16:56:48 -07:00
Igor Minar 1702e49548 chore(Rakefile): remove bogus symlink from build 2012-08-29 14:58:10 -07:00
Igor Minar d6706efe7f chore(docs): use symlinks to build docs
so that we can just edit source files without rebuilding docs.

this works for all docs files, except for those that are generated
or rewritten during build.
2012-08-28 16:06:50 -07:00
Igor Minar b08d4b22d2 chore(Rakefile): various build script changes
- restructure rake tasks

  this splits up the concatination and minification into two
  tasks so that we can just build angular.js quickly without wasting
  time with minification which is often not needed when just debugging
  some issue on 3rd party site.

- use symlinks when creating final zip file

- switch from btar to zip

- get rid of version numbers from filenames

- rewrite version numbers in all index files

Closes #1226
2012-08-28 12:38:34 -07:00
Misko Hevery e8ded01cf5 doc($log): correct non-working example 2012-08-27 15:44:38 -07:00
Misko Hevery 7a5f25f667 doc(guide): add concepts 2012-08-27 15:44:38 -07:00
Misko Hevery 96697f464f fix(ngdoc): failing test 2012-08-27 15:44:38 -07:00
Colin Frei 7e18724dfa doc(directive) correct typos 2012-08-27 15:01:50 -07:00
Misko Hevery c269eb3d26 fix(docs) typo 2012-08-27 14:59:19 -07:00
Misko Hevery fa62ea810f fix(ng-list): remove data bound flicker 2012-08-27 14:59:18 -07:00
Misko Hevery bf8ed8a532 doc(misc) updated getting started to reflect the new homepage 2012-08-27 14:59:18 -07:00
Misko Hevery d05a2809a1 doc(guide) simplify the guide home page 2012-08-27 14:59:17 -07:00
Igor Minar fa6c8c3131 chore(Rakefile): rewrite version numbers in all index files 2012-08-27 12:26:04 -07:00
Igor Minar f7ac8ef97a chore(docs): support _escaped_fragment_ hack for crawler 2012-08-25 02:30:55 -07:00
Igor Minar 4a4b28dbf3 chore(docs): use GAE and Google CDN for docs
Short summary: if you use local node server everything should work as before,
if you use GAE, everything should work now as well, but we pull assets from CDN.

- GAE doesn't support ':' in filenames, so I had to replace it with '_'
  but only in the filename, all servers were reconfigured to rewrite the
  urls from : to _ when doing file lookup
- We now pull angular assets from google CDN when deployed on GAE (locally
  or in production). When running on a non GAE server we pull assets from
  ../ directory as before
- Since only certain versions of Angular are available on CDN and we want
  to be able to autodeploy docs, I had to pin down the Angular files
  to a "stable" version when running on GAE
2012-08-24 14:54:35 -07:00
Igor Minar 3e12bc481d docs(a): expose hidden docs
It seems that docs for these directive were previously hidden by accident
2012-08-24 14:54:34 -07:00
johnlindquist 32137cab82 docs(ngRoute): fix typo
aftre -> after
2012-08-23 15:11:07 -04:00
phil f7b4296c38 docs(tutorial): fix typo in step_00
Just removed an extra comma. No big deal.
2012-08-23 01:02:28 -07:00
Igor Minar cab5e1d9b3 fix(docs): update docs top menu links 2012-08-16 11:26:36 -07:00
Igor Minar dfe99836cd fix($compile): denormalize directive templates
Since developers are allowed to customize start/end interpolation
strings, but third-party directive creators don't know about these
customizations, we should standardize on {{ }} in templates of
reusable (third-party) directives. During the compilation, these
templates are then denormalized to use whatever the custom
start/end symbol is, effectively translating the template into the
syntax of the runtime environment.

This addresses an issue raised at http://goo.gl/e8VPV

Existing code should not be affected by this change since project
that do use custom interpolation markers are not expected to use
{{ }} in existing directive templates.
2012-08-13 14:33:56 -07:00
Igor Minar 0f37194fb7 refactor($compile): code cleanup 2012-08-13 09:48:23 -07:00
Brian Ford e85774f709 fix(ngPluralize): fixes ng-pluralize when using non-standard start/end symbols
Closes #1134
2012-08-13 09:48:23 -07:00
Igor Minar 44345c74de style(ngPluralizeSpec): fix indentation 2012-08-13 09:48:22 -07:00
Igor Minar 58f121a5c2 feat($interpolate): expose start/end symbols in run phase
previously the startSymbol() and endSymbol() getters were exposed only via provider
in the config phase
2012-08-13 09:48:22 -07:00
Igor Minar cf6023ef22 docs($interpolateProvider): fixing docs 2012-08-13 09:48:22 -07:00
Igor Minar 2034871764 fix($interpolate): $interpolateProvider.endSymbol() returns startSymbol
I also added missing tests.
2012-08-13 09:48:21 -07:00
Igor Minar 15d283b114 docs($interpolate): fix typo in description 2012-08-13 09:48:21 -07:00
Vojta Jina 9be169365c docs($compileProvider): remove duplicate of .directive() 2012-08-12 10:45:14 -07:00
Vojta Jina 00683a8bbb docs: fix broken links to $compileProvider.directive() 2012-08-12 10:44:29 -07:00
Brian Ford f00b6cca02 fix(docs): fixed documentation for using linky 2012-08-10 16:33:25 -07:00
Brian Ford e05a97c6f5 chore(ngDoc): add support for custom @usage metadata 2012-08-10 16:33:13 -07:00
Brian Ford 2e3651686c fix(docs): added note about using JSON3 as a polyfill for IE7 2012-08-10 16:27:44 -07:00
Brian Ford 536de14821 fix(docs): added note about needing JSON shim for IE7 and earlier 2012-08-10 16:27:44 -07:00
Vojta Jina e0a54f6b20 feat($http): support reponseType
Closes #1013
2012-08-10 16:17:59 -07:00
Igor Minar 9767f7bdd3 fix(option): support option elements in datalist
previously we expected to find option elements only within select element and if
that was not the case we throw an error. This made it impossible to include datalist
element with nested option elements in the template.

Closes #1165
2012-08-10 16:14:30 -07:00
Vojta Jina 167aa0c29c feat($sniffer): auto detect CSP mode
Chrome Canary now has CSP with apis that allow auto-detection. This change
will turn on CSP mode automatically when we detect its presence.

https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-interfaces--experimental
2012-08-10 14:53:53 -07:00
unirgy 4ccd9eb883 docs($rootScope): fix $on listener signature doc
Added args in $on() listener syntax declaration
2012-08-10 14:50:22 -07:00
Igor Minar c0d638a94b test(jqLite): add missing test for $destroy event 2012-08-10 13:04:39 -07:00
Igor Minar 054d40f338 fix(form): prevent page reload when form destroyed
this fix ensures that we prevent the default action on form submission
(full page reload) even in cases when the form is being destroyed as
a result of the submit event handler (e.g. when route change is
triggered).

The fix is more complicated than I'd like it to be mainly because
we need to ensure that we don't create circular references between
js closures and dom elements via DOM event handlers that would then
result in a memory leak.

Also the differences between IE8, IE9 and normal browsers make testing
this ugly.

Closes #1238
2012-08-10 13:03:55 -07:00
Igor Minar 5cec32492c test(form): fix broken preventDefault test
the original test relied on incorrect assumptions about how jasmine async
tests work (when setTimeout is triggered) and how browser reloads a page
(the sequence of events) and thus the test passes even when the default
is not prevented.

this change fixes the test by registering an extra submit event handler
that checks if the default was prevented.

if the default was not prevented, the test will fail and the page will
be reloaded causing the test runner to panic.
2012-08-07 22:07:49 -07:00
Igor Minar c25cb7d488 refactor(formSpec): group preventDefault specs into a describe 2012-08-07 17:23:16 -07:00
Igor Minar 54e4a6ffbf docs(faq): update faq docs 2012-08-07 10:15:54 -07:00
Igor Minar eee9a51fad docs(styles): fix the cog icon alignment 2012-08-06 16:54:18 -07:00
Vojta Jina 77e6d833f6 chore(nodeserver): add font mime type 2012-08-04 12:09:28 -07:00
Vojta Jina 33ad2b4126 docs(guide): hide scenario for directive example
scenario test for this example would be tricky, we need to teach
the runner how to inject mocks first.
2012-07-30 21:21:34 -07:00
Vojta Jina b84eaffd39 docs: fix icons
Copy fontawesome during build
2012-07-30 21:20:28 -07:00
brettcannon a1107e81eb fix(docs): "in depth" -> "in-depth" 2012-07-20 20:54:42 -07:00
JP Sugarbroad e3e8813e3c refactor($injector): move $injector into the providerCache
Better than special-casing '$injector' in createInjector.
2012-07-19 21:56:22 -07:00
Igor Minar 6e2d9711e8 chore(release): start 1.1.0 increase-gravatas iteration 2012-07-19 21:48:58 -07:00
Igor Minar d3952b79c7 docs(readme): improve blurb about AngularJS in README.md 2012-07-19 21:48:45 -07:00
brettcannon 5ef9ed87d8 fix(docs): Capitalize Angular. 2012-07-19 15:23:21 -07:00
brettcannon 8c81a0f372 fix(docs): Fix a spelling mistake by replacing the noun with "it" 2012-07-19 15:04:29 -07:00
brettcannon bde931afd5 fix(docs): "were" -> "where" 2012-07-19 11:28:19 -07:00
brettcannon 6553fe68d1 fix(docs): Capitalize "URL". 2012-07-19 11:05:38 -07:00
Chris Dawson 13b5fd1b9d fix(docs): Fixed defer to timeout change in timer directive example 2012-07-19 10:04:22 -07:00
Chris Dawson 17209d5b4a fix(docs): Spelling errors 2012-07-19 10:01:50 -07:00
brettcannon 6f9a5721bc fic(docs): Consistently use __bold__ for things that must be done when moving the ng-controller declaration. 2012-07-19 09:57:58 -07:00
brettcannon 31c825607d fix(docs): Tweak some grammar and add some links relating to DI. 2012-07-19 09:54:53 -07:00
brettcannon ab6937e251 fix(docs): Capitalize "APIs" 2012-07-19 09:49:44 -07:00
brettcannon fbfda241f6 fix(docs): Capitalize "Angular". 2012-07-19 09:35:43 -07:00
brettcannon 206371b737 fix(docs): Capitalize Angular. 2012-07-19 09:26:34 -07:00
brettcannon b6b92bd866 fix(docs): Add a missing "the". 2012-07-19 09:09:52 -07:00
brettcannon 79f2d843a8 fix(docs): ngRepeater isn't a thing, ngRepeat is 2012-07-19 09:04:59 -07:00
brettcannon 64a9cd8f4f fix(docs): Remove a redundant "in". 2012-07-19 09:02:04 -07:00
brettcannon 7f6e1326f3 fix(docs): Grammatical fix 2012-07-18 15:48:08 -07:00
brettcannon 1fd2b3d402 fix(docs): Fixed some awkward wording 2012-07-18 15:42:29 -07:00
brettcannon d56d69cc83 fix(docs): Tweak formatting and wording of a list 2012-07-18 15:20:38 -07:00
brettcannon 01e726b2fa fix(docs): Don't want the present participle of "is" 2012-07-18 15:15:09 -07:00
brettcannon 1613621645 fix(docs): Adjectve accidentally made into an adverb 2012-07-18 12:16:14 -07:00
brettcannon 92a3d28218 fix(docs): Minor grammatical fix 2012-07-18 11:52:57 -07:00
Rishabh Rao 4c58501956 fix(docs): Fixed typo: changed ngRepeate to ngRepeat. 2012-07-16 12:33:19 -07:00
Jamie Krug c076fe08cf fix(docs): Fix spelling, punctuation and grammatical errors on dev guide bootstrap page. 2012-07-16 12:10:43 -07:00
Jamie Krug 2473412ba5 fix(docs): Fix spelling, punctuation and grammatical errors on dev guide compiler page. 2012-07-16 12:10:42 -07:00
Jamie Krug 1f2d50000e fix(docs): Fix spelling, punctuation and grammatical errors on dev guide overview page. 2012-07-16 12:10:33 -07:00
Kevin Old 5026315d6f fix(docs): correct typo 2012-07-16 11:40:21 -07:00
Igor Minar a8b04004e3 docs(readme): add blurb about AngularJS to README.md 2012-07-02 08:21:19 -07:00
Igor Minar f0a090ddf2 fix(docs): correctly generate sitemap 2012-07-02 08:21:19 -07:00
Igor Minar 6d9313a68d fix(docs): fix broken ng-docs specs 2012-07-02 08:21:19 -07:00
Vojta Jina 212f685e06 chore(changelog): fix typos in rc11 changelog 2012-06-25 20:36:41 -07:00
Igor Minar 35706ba482 chore(release): starting the 1.0.2 debilitating-awesomeness iteration 2012-06-25 12:52:32 -07:00
Igor Minar 9bef436b22 chore(release): cutting the 1.0.1 thorium-shielding release 2012-06-25 09:30:57 -07:00
Igor Minar 3f14a45aa5 docs(changelog): release notes for 1.0.1 thorium-shielding 2012-06-25 09:30:57 -07:00
Misko Hevery ffb270130a fix(browser): prevent ie from getting into redirect loop
Closes #1075
Closes #1079
Closes #1085
2012-06-22 10:21:31 -07:00
Igor Minar 0d57f1373f chore(release): starting the 1.0.1 iteration 2012-06-21 13:59:53 -07:00
Igor Minar 869143ec7d chore(logos): fix shield logo exports
the previous version is clipped at the top
2012-06-21 13:58:24 -07:00
Igor Minar 1e6d4d5f54 fix(logo): center A in the shield 2012-06-21 13:58:24 -07:00
Vojta Jina 3da4194f98 fix($location): url rewriting if element was removed
When user clicks a link, $location needs to intercept this event.  The <a> doesn't have to be target element of the DOM event, so it needs to traverse the DOM, to find first <a> parent.

If the target element was removed from DOM, during the same event, it would throw an exception. This fixes the issue.

Closes #1058
2012-06-20 12:18:48 -07:00
Misko Hevery ad5d2f2991 fix(doc) firefox icon rendering 2012-06-15 10:40:25 -07:00
Igor Minar 519bef4f3d chore(release): cutting the 1.0 temporal-domination release 2012-06-14 10:50:22 -07:00
Igor Minar 6dfe5be155 docs(changelog): release notes for 1.0 temporal-domination release 2012-06-14 10:50:22 -07:00
Misko Hevery 6593a3e082 fix($location): fix URL interception in hash-bang mode
Closes #1051
2012-06-14 10:48:56 -07:00
Misko Hevery 0f44964e5e fix($location): correctly parse link urls in hashbang mode with prefix
This is a second fix for a regression that was introduced by 92a2e180.
The fix addresses scenarios when the $location service is configured with
a hash prefix.

Closes #1037
2012-06-13 10:49:05 -07:00
Igor Minar f6b09b9139 chore(release): starting the 1.0 temporal-domination iteration 2012-06-13 10:46:22 -07:00
Igor Minar 7fa1995e08 chore(release): cutting the 1.0.0rc12 regression-extermination release 2012-06-12 01:46:02 -07:00
Igor Minar da94b03af7 docs(changelog): release notes for 1.0.0rc12 regression-extermination 2012-06-12 01:45:26 -07:00
Igor Minar f158d81d21 docs($browser): hide $browser docs - it's a private service 2012-06-12 01:14:45 -07:00
Igor Minar 9af7a9198e fix($defer): remove deprecated $defer service 2012-06-12 01:09:07 -07:00
Misko Hevery 74fa65ecb7 fix($location): correctly parse link urls in hashbang mode
This is a fix for a regression that was introduced by 92a2e180

Closes #1037
2012-06-12 00:27:25 -07:00
Igor Minar ee6014a3aa fix($location): throw Errors not Strings 2012-06-12 00:27:24 -07:00
Igor Minar d9ff5fd432 fix(docs): migrate from $defer to $timeout 2012-06-12 00:11:04 -07:00
Igor Minar f16150d5f1 docs(*): simplify doc urls
we now have two types of namespaces:

- true namespace: angular.* - used for all global apis
- virtual namespace: ng.*, ngMock.*, ... - used for all DI modules

the virual namespaces have services under the second namespace level (e.g. ng.)
and filters and directives prefixed with filter: and directive: respectively
(e.g. ng.filter:orderBy, ng.directive:ngRepeat)

this simplifies urls and makes them a lot shorter while still avoiding name collisions
2012-06-12 00:10:18 -07:00
Igor Minar fc0b2b5715 chore(logos): adding AngularJS and shield logos 2012-06-11 14:13:18 -07:00
Igor Minar f3f090da8a chore(release): start 1.0.0rc12 regression-exterminator release
quick release to fix $location regression
2012-06-11 14:10:02 -07:00
Igor Minar 068f2f9d43 chore(release): cutting the 1.0.0rc promise-resolution release 2012-06-11 00:03:01 -07:00
Igor Minar 2d48733723 docs(changelog): release notes for 1.0.0rc11 promise-resolution 2012-06-11 00:03:01 -07:00
Igor Minar d37d595b67 test($location): fix tests borked during event renaming 2012-06-10 17:42:44 -07:00
Igor Minar 5d70e4a89c docs(*): fix various outdated docs and examples
Closes #1030
2012-06-10 09:01:42 -07:00
Igor Minar b5bba65a93 docs($location): clarify the two-way data-binding note
Closes #1030
2012-06-09 06:57:55 -07:00
Max Martinsson fb99b539b4 fix($compile): correctly merge class attr for replace directives
Merging of interpolated class attribute from directive template with replace:true works

Closes #1006
2012-06-08 16:07:15 -07:00
Vojta Jina 10f80d7d29 fix($http): add utf-8 to default Content-Type header (post/put)
This fixes special characters issue with MongoLab.

https://groups.google.com/d/topic/angular/1T6h7bfZ7Rs/discussion
2012-06-08 16:07:15 -07:00
Misko Hevery c3a41ff9fe feat($compile): simplify isolate scope bindings
Changed the isolate scope binding options to:
  - @attr - attribute binding (including interpolation)
  - =model - by-directional model binding
  - &expr - expression execution binding

This change simplifies the terminology as well as
number of choices available to the developer. It
also supports local name aliasing from the parent.

BREAKING CHANGE: isolate scope bindings definition has changed and
the inject option for the directive controller injection was removed.

To migrate the code follow the example below:

Before:

scope: {
  myAttr: 'attribute',
  myBind: 'bind',
  myExpression: 'expression',
  myEval: 'evaluate',
  myAccessor: 'accessor'
}

After:

scope: {
  myAttr: '@',
  myBind: '@',
  myExpression: '&',
  // myEval - usually not useful, but in cases where the expression is assignable, you can use '='
  myAccessor: '=' // in directive's template change myAccessor() to myAccessor
}

The removed `inject` wasn't generaly useful for directives so there should be no code using it.
2012-06-08 15:50:13 -07:00
Igor Minar 5c95b8cccc fix(startingTag): make tag name always lowercase
some browsers (IE) always provide the nodeName as upper-case
2012-06-08 15:27:04 -07:00
Misko Hevery 9be82d942f refactor($compile): always call attr.$observe
attr.$observe used to call function only if there was interpolation
on that attribute. We now call the observation function all the time
but we only save the reference to it if interpolation is present.
2012-06-08 15:27:03 -07:00
Misko Hevery 2491319575 chore($compile): clean up compiler tests 2012-06-08 15:27:02 -07:00
Misko Hevery bcc3a021eb chore(jqLite): performance reordering 2012-06-08 15:27:02 -07:00
unknown a57141fd1d docs(guide): correct couple of typos 2012-06-04 18:46:09 -07:00
Ali Mills 1904596e0c fix($timeout): allow calling $timeout.cancel() with undefined
This is how it worked in rc9, before refactoring $defer into $timeout.
2012-06-04 17:43:14 -07:00
Igor Minar 22143381d8 chore(release): starting 1.0.0rc11 promise-resolution iteration 2012-06-04 10:03:59 -07:00
Misko Hevery ddefb42445 doc(app): switch to use $last on ng-repeat 2012-06-02 16:02:09 -07:00
Misko Hevery 676d6e0040 doc(app): remove un-needed file 2012-06-02 16:02:09 -07:00
Misko Hevery 8024a5742c doc(NgModelController) add example and $render documentation
Closes#930
2012-06-02 16:02:09 -07:00
Misko Hevery 073e76f835 doc(guide): corrected examples 2012-06-02 16:02:09 -07:00
Misko Hevery 7019f142ab merge cleanup 2012-06-02 16:02:09 -07:00
Misko Hevery 0532aabcf9 doc(guide): clean up broken links 2012-06-02 16:02:08 -07:00
Misko Hevery f0be543614 doc(ngdoc): clean up doc generation and add missing documentation links 2012-06-02 16:02:08 -07:00
Misko Hevery a3a37c2063 doc(compiler): rewrite 2012-06-02 16:02:08 -07:00
Misko Hevery 0f5259c5a2 docs(introduction): rename 2012-06-02 16:02:08 -07:00
Misko Hevery 321a4a6b1f doc(i18n): rename 2012-06-02 16:02:08 -07:00
Misko Hevery 41d26db32c docs(expression): rewrite 2012-06-02 16:02:08 -07:00
Misko Hevery dd38ce6585 docs(scope): rewrite 2012-06-02 16:02:07 -07:00
Misko Hevery 2e90cdc3d4 docs(dependency injecton): rewrite 2012-06-02 16:02:05 -07:00
Misko Hevery 581f93ae56 docs(ngdocs): cleaned up directive titles 2012-06-02 16:02:05 -07:00
Misko Hevery 6933fb7924 docs(bootstrap): rewritten bootstrap guide 2012-06-02 16:02:05 -07:00
Misko Hevery f5afcca99d docs(overview): updated overview guide 2012-06-02 16:02:04 -07:00
Misko Hevery 2356c21650 doc(ngdoc): proper label for source and demo section 2012-06-02 16:02:04 -07:00
Misko Hevery 275e5335dc fix(docs): include short words in keywords
Short words like $q are now searchable.

Closes #967
2012-06-02 15:44:58 -07:00
Misko Hevery 92a2e18076 feat($location): add $locatonChange[begin|completed] event
This allows location change cancelation
2012-06-02 15:44:58 -07:00
Misko Hevery 8aa18f0ad0 chore($location) switch to use $rootElement 2012-06-02 14:51:03 -07:00
Misko Hevery 85632cb44c feat($rootElement): added application root element
Publish the application root element as $rootElement
so that it can be injected to other services.
2012-06-02 14:50:58 -07:00
Misko Hevery 0a6e464a93 feat($route): rename template -> tempalteUrl and add support for inline templates
BREAKING CHANGE: template in $route definition is now templateUrl
To migrate just rename `template` to `templateUrl`.
2012-06-01 17:01:10 -07:00
Misko Hevery 7c24282188 chore($route): rename events
BREAKING CHANGE

rename $beforeRouteChange to $routeChangeStart
rename $afterRouteChange to $routeChangeSuccess
2012-06-01 16:57:49 -07:00
Misko Hevery 885fb0dd07 feat($route): resolve local route promises
Resolve all promises on route before we fire $afterRouteChange which then renders the ngView.
2012-06-01 16:56:31 -07:00
Misko Hevery 4361efb03b feat($injector): provide API for retrieving function annotations 2012-06-01 10:57:51 -07:00
Misko Hevery 416a783040 fix(jqLite): don't eat event exceptions
JQuery does not catch exceptions either, and just
lets them pass. This allows the exception to be
shown in console.
2012-05-24 13:48:44 -07:00
Misko Hevery bbaf9a2870 fix(docs): accept return in addition to returns
documentation used @return but parser expected
@returns, which made the generated documentation
incomplete.
2012-05-24 13:48:42 -07:00
Misko Hevery 7e70463da1 chore(docs): remove generated file 2012-05-24 13:48:42 -07:00
Misko Hevery 4235ee9ad6 chore(docs): remove unused doc_widget.js file 2012-05-24 13:48:40 -07:00
Misko Hevery 3fdb29242b chore(docs): correct spacings 2012-05-24 13:48:38 -07:00
Misko Hevery b5fb18ae35 fix(favicon): update to aliased icon 2012-05-24 13:48:31 -07:00
Igor Minar 5fdf42ce39 chore(release): cut the 1.0.0rc10 tesseract-giftwrapping release 2012-05-23 21:05:21 -07:00
Igor Minar bf6a0b7289 docs(changelog): release notes for 1.0.0rc10 tesseract-giftwrapping 2012-05-23 16:37:37 -07:00
Misko Hevery 989446ecee fix($rootScope): TTL exception does not clear $$phase
When $digest() throws infinite digest exception it
does not properly clear the $phase leaving the scope
in an inconsistent state.

Closes #979
2012-05-23 16:01:20 -07:00
Igor Minar 5214c1d0cb chore(package.json): add simple package.json with npm dependencies 2012-05-23 15:00:56 -07:00
Igor Minar 4511d39cc7 feat($timeout): add $timeout service that supersedes $defer
$timeout has a better name ($defer got often confused with something related to $q) and
is actually promise based with cancelation support.

With this commit the $defer service is deprecated and will be removed before 1.0.

Closes #704, #532
2012-05-23 15:00:56 -07:00
Daniel Gomes 15b8f205bb docs($filter): minor corrections 2012-05-22 14:27:26 -07:00
Max 1d388676e3 fix(ngRepeat): expose $first, $middle and $last instead of $position
$position marker doesn't work well in cases when we have just one item
in the list because then the item is both the first and last. To solve
this properly we need to expose individual $first and $middle and $last
flags.

BREAKING CHANGE: $position is not exposed in repeater scopes any more

To update, search for $position and replace it with one of $first,
$middle or $last.

Closes #912
2012-05-22 14:18:15 -07:00
Vojta Jina 84542d2431 feat(scope): add event.preventDefault() and event.defaultPrevented 2012-05-17 15:47:53 -07:00
Vojta Jina 91db99208e refactor(scope.$emit): rename event.cancel() to event.stopPropagation()
Breaks event.cancel() is event.stopPropagation()
2012-05-17 15:47:52 -07:00
Misko Hevery acf095d178 fix(jqLite): have same expando format as jQuery 2012-05-17 10:36:45 -07:00
Igor Minar 301d8f233b chore(release): start 1.0.0rc10 tesseract-giftwrapping iteration 2012-05-15 00:09:08 -07:00
Igor Minar d70223e53e chore(release): cutting 1.0.0rc9 eggplant-teleportation 2012-05-14 22:13:15 -07:00
Igor Minar 8ad02bb5a8 docs(changelog): release notes for 1.0.0rc9 eggplant-teleportation 2012-05-14 22:00:18 -07:00
Misko Hevery ec1c5dfaee fix(jqLite): .data()/.bind() memory leak
Since angular attaches scope/injector/controller
into DOM it should clean up after itself. No need
to complain about memory leaks, since they can
only happened on detached DOM. Detached DOM would
only be in tests, since in production the DOM
would be attached to render tree and removal
would automatically clear memory.
2012-05-14 21:56:22 -07:00
Misko Hevery 24e7da4f19 fix(angular-mocks): memory leak in jasmine's DI utils
When using inject/module helper methods in tests, these methods would
leave the injector laying around after the test. Since injector is
the application it can grow very large.
2012-05-14 21:56:22 -07:00
Vojta Jina 7b739c9702 fix($sniffer): report history false on Android < 4
Android has history.pushState, but it does not update the location correctly:
http://code.google.com/p/android/issues/detail?id=17471

Closes #904
2012-05-14 15:12:51 -07:00
Igor Minar c1533ef576 fix($location): support urls with any protocol
The url used for location parsing was quite strict and did not support
custom url schemes like "chrome-extension://". With this change the only
requirement for scheme is that it doesn't contain ":" character.
2012-05-14 14:45:56 -07:00
Igor Minar 679cb8a74a fix($browser/$location): single quote in url causes infinite digest in FF
The real issue is in FF, see https://bugzilla.mozilla.org/show_bug.cgi?id=407172.

FF overly encodes stuff which breaks our expectations and then we fail .url() != currentUrl.absUrl()
comparison unexpectidly, which leads to infinite digest.

The workaround is to correct for this inconsistency in $browser and decode any single quotes in urls.

Closes #920
2012-05-13 21:53:19 -07:00
Igor Minar 4e65635f85 doc($rootScope): fix $digest example 2012-05-08 17:00:25 -07:00
Misko Hevery aa02534865 bug(ie8 docs): docs now work on ie8 2012-05-07 15:43:09 -07:00
Misko Hevery b99f65f64d bug(html5 navigation): broken in Opera
http://my.opera.com/community/forums/topic.dml?id=1185462

Closes# 938
2012-05-07 15:43:09 -07:00
Igor Minar f76474823a chore(release): starting 1.0.0rc9 eggplant-teleportation interation 2012-05-07 00:11:50 -07:00
Igor Minar 8ba1fd87e1 chore(release): cutting the 1.0.0rc8 blooming-touch release 2012-05-07 00:09:20 -07:00
Igor Minar 4d2dd46483 docs(changelog): release notes for 1.0.0rc8 blooming-touch 2012-05-07 00:08:43 -07:00
Igor Minar b24cc63bcb fix(ngSrc,ngHref): binding should set element prop as well as attr
IE9 ignores setAttribute('src', val) calls on img if "ng:src" attribute
is present. It only fetches the image if element property is updated as well.

Closes #935
2012-05-06 23:01:33 -07:00
Igor Minar 49dfdf8f02 fix(ngModel): use keydown/change events on IE9 instead of input
On IE9 the input event is not fired when backspace or delete key are pressed or when
cut is performed. This makes listening on the input event unreliable and therefore
it's better for us to just use keydown/change events instead.

Closes #879
2012-05-06 23:01:33 -07:00
Vojta Jina 5bcb749abb fix(scenario): make browser().location() working if ng-app on other than <html> 2012-05-05 03:30:28 +02:00
Vojta Jina 499a76a08c fix($parse): support methods on falsy primitive types
e.g. zero, false, empty string

- fix tests to be executed with csp true
- fix cps (when more than 5 parts)
2012-05-05 03:30:19 +02:00
Misko Hevery 8e2675029f chore(docs): re-skin main documentation 2012-05-04 16:12:17 -07:00
Misko Hevery d0159454df bug($cookie): set on app base path rather the current path. 2012-05-04 15:50:39 -07:00
Misko Hevery 7f0eb15161 fix($compile): have $observe return registration function 2012-05-04 15:50:39 -07:00
Misko Hevery c4fa487250 feat(bootstrap): support code prettify and dropdown from bootstrap 2012-05-04 15:50:37 -07:00
Misko Hevery cef3535c16 chore(controller): allow setting map of controllers 2012-05-04 15:50:37 -07:00
Misko Hevery fbb499e0a8 chore(module): improved module prefix/suffix code 2012-05-04 15:50:37 -07:00
Misko Hevery e40f8d829f chore(debug): rewrite angular-bootstrap.js to use $script 2012-05-04 15:50:37 -07:00
Igor Minar 9c0418cf1a fix($compile): ignore ws when checking if template has single root
Also add the same error checking for sync templates.

Closes #910
2012-05-04 13:01:55 -07:00
Igor Minar 1564b82b49 style($compile): rename orig*Node to beforeTemplate*Node 2012-05-03 23:40:43 -07:00
Igor Minar b431ee3850 fix($compile): fix replaceWith
the old implementation didn't reattach jquery/jqlite data which caused
things like  to be lost

I tried various implementations but it appears that by reattaching the data
to the new node by copying the expando property is the most reliable of all.
2012-05-03 23:40:43 -07:00
Igor Minar a44d3dcd6a chore(testabilityPatch): print number of leaked references if any 2012-05-03 23:31:28 -07:00
Igor Minar ee579a071a feat(jqLite): support data() getter and data(obj) setter
... just like jquery does
2012-05-03 23:31:28 -07:00
Igor Minar 5df7e6fae5 style(jqLite): clean up the code 2012-05-03 23:31:28 -07:00
Igor Minar fff31d8d61 style($compile): clean up the code and normalize fn names 2012-05-03 23:31:28 -07:00
Igor Minar 9cba23a588 chore(trace): add helper method trace
use it as trace('label') to dump the stack during debugging
2012-05-03 10:07:30 -07:00
Igor Minar 705f4bbf11 fix($compile): attach scope to the directive element when templateUrl and replace=true
We forgot to reattach the scope to the replacement element. This affected only
directives that had templateUrl and replace:true properties.

Reported on the mailing list:
https://groups.google.com/forum/?fromgroups#!topic/angular/zwjLr1msS2Y
http://jsfiddle.net/lukebayes/g9Sh9/
2012-05-03 00:15:26 -07:00
Igor Minar bd530e2257 chore($compile): remove obsolete <<CONTENT>> transclusion
This stuff was never documented and is an accidental leftover from the time
when the compiler was rewritten.

If any code depends on this, it should be rewritten to use ngTransclude directive
intead.
2012-05-03 00:15:26 -07:00
Igor Minar 843f762c57 fix($compile): prevent duplicate directive controller instantiation
Closes #876
2012-05-03 00:15:26 -07:00
Igor Minar beea3a4bed style($compile): rename compiler.js to compile.js 2012-05-02 16:37:48 -07:00
Igor Minar 3bd3cc571d fix(select): don't interfere with selection if not databound
Closes #926
2012-05-02 14:24:43 -07:00
Igor Minar c7f1101520 chore(release): starting the 1.0.0rc8 blooming-touch iteration 2012-05-02 14:21:30 -07:00
Igor Minar 76afa406b1 chore(release): cut 1.0.0rc7 rc-generation release 2012-04-30 16:32:45 -07:00
Igor Minar f3c77858be docs(changelog): release notes for 1.0.0rc7 rc-generation 2012-04-30 15:53:05 -07:00
Igor Minar 96758c1c52 docs(ngCsp): make the CSP docs publicly visible 2012-04-30 15:37:12 -07:00
Igor Minar 006fb4fbeb docs(ngSanitize): fix directive links 2012-04-30 01:09:55 -07:00
Igor Minar 075c089b5c docs(tutorial): update all the remaining steps
I made some diagrams and portions of the text that are stil stale
invisible. We'll fix these in the next relese.
2012-04-30 01:08:15 -07:00
Igor Minar 2b87c814ab feat($parse): CSP compatibility
CSP (content security policy) forbids apps to use eval or
Function(string) generated functions (among other things). For us to be
compatible, we just need to implement the "getterFn" in $parse without
violating any of these restrictions.

We currently use Function(string) generated functions as a speed
optimization. With this change, it will be possible to opt into the CSP
compatible mode using the ngCsp directive. When this mode is on Angular
will evaluate all expressions up to 30% slower than in non-CSP mode, but
no security violations will be raised.

In order to use this feature put ngCsp directive on the root element of
the application. For example:

<!doctype html>
<html ng-app ng-csp>
  ...
  ...
</html>

Closes #893
2012-04-27 23:04:24 -07:00
Igor Minar 2b1b257034 chore(server.js): Add CSP support
The support is disabled by default, uncomment relevant lines to enable
it.
2012-04-27 22:04:16 -07:00
Igor Minar 73caf76225 chore(check-size): add a script to check gziped size
this is useful to quickly check the resulting size during development
2012-04-23 11:42:27 -07:00
Igor Minar dbb92efd13 chore(release): start 1.0.0rc7 rc-generation iteration 2012-04-23 11:42:26 -07:00
Vojta Jina 1214084e9d docs(directive): fix transclusion examples 2012-04-21 21:08:30 +02:00
Misko Hevery a18926f986 fix(events): include ie8 in extra event property reset 2012-04-20 17:04:21 -07:00
Misko Hevery b806b30861 fix(bootstrap): rewritten to $script 2012-04-20 17:04:21 -07:00
Misko Hevery 43d15f830f fix(mouseenter): FF no longer throws exceptions 2012-04-20 17:04:21 -07:00
Igor Minar 1d26acb874 chore(release): cutting the 1.0.0rc6 runny-nose release 2012-04-20 15:06:39 -07:00
Igor Minar 983c309542 docs(changelog): release notes for 1.0.0rc6 runny-nose 2012-04-20 15:06:05 -07:00
Igor Minar 904b69c745 fix(select): properly handle empty & unknown options without ngOptions
Previously only when ngOptions was used, we correctly handled situations
when model was set to an unknown value. With this change, we'll add/remove
extra unknown option or reuse an existing empty option (option with value
set to "") when model is undefined.
2012-04-20 14:29:37 -07:00
Igor Minar c65c34ebfe test(selectSpec): clean up and simplify specs 2012-04-20 14:29:36 -07:00
Igor Minar 8ebe5ccd9a feat(jquery): jquery 1.7.2 support 2012-04-20 14:29:36 -07:00
simpulton e61fd1b43a feat($resource): support HTTP PATCH method
Properly serialize data into request body instead of url.

Closes #887
2012-04-20 12:32:33 -07:00
Misko Hevery ce15a3e049 chore(license): update to google 2012-04-20 11:29:34 -07:00
Misko Hevery 46bb08a9d0 fix(compiler): reading comment throws error in ie
Unders some circumstances reading the comment's text throws error.
2012-04-20 11:29:34 -07:00
Misko Hevery 94dd685709 fix(script): Incorrectly reading script text on ie
IE deals with script tags in special way and .text() does not work. Reading the .text property directly fixes the issue.
2012-04-20 11:29:34 -07:00
Misko Hevery dc32ea627e chore(logo): added angular shield logo 2012-04-20 11:29:33 -07:00
Misko Hevery eafe15f54c fix(document): accidental clobbering of document.getAttribute
Closes #877
2012-04-20 11:29:33 -07:00
Chris Dawson 666f326c5d docs(guide/controllers): update w/ controller scope separation 2012-04-20 10:57:26 -07:00
pkozlowski-opensource 908785960d docs(guide/e2e): fix a link to e2e dsl 2012-04-20 10:49:44 -07:00
johnlindquist 5cc245dd80 docs(ngBind): "angular.module.ng.$sanitize" -> "angular.module.ngSanitize.$sanitize" 2012-04-20 10:44:18 -07:00
johnlindquist 0bd0ef7813 docs($compile) "updateh"->"updated" 2012-04-20 10:43:58 -07:00
johnlindquist 0c7252f929 docs(ngBind): "makes make" -> "makes" 2012-04-20 10:43:41 -07:00
Vojta Jina b94fb5c8c1 docs($resource): fix the example 2012-04-15 09:42:54 -07:00
Igor Minar c322735f83 chore(release): starting the 1.0.0rc6 runny-nose iteration 2012-04-12 03:57:14 -07:00
Igor Minar 9260b4937d chore(release): cutting the 1.0.0rc5 reality-distortion release 2012-04-12 03:56:28 -07:00
Igor Minar e9ccec76a6 docs(changelog): release notes for 1.0.0rc5 reality-distortion 2012-04-12 03:26:10 -07:00
Igor Minar 2037facc99 docs(tutorial): update step-04 to v1.0 2012-04-12 02:45:12 -07:00
Igor Minar b2d0a386f6 style(docs-scenario.html): rename <angular/> to AngularJS in the title 2012-04-12 02:36:03 -07:00
Igor Minar 6d7e7fdea6 fix($location): properly rewrite urls in html5 mode with base url set
previously we were doing all kinds of checks to see if we should rewrite the url or not and we
were missing many scenarios. not any more.

with this change, we rewrite the url unless:
- the href is not set
- link has target attribute
- the absolute url of the link doesn't match the absolute prefix for all urls in our app

This also means that ng-ext-link attribute which we previously used to distinguish external
links from app links is not necessary any more. apps can just set target=_self to prevent
rewriting.

BREAKING CHANGE: ng-ext-link directive was removed because it's unnecessary

apps that relied on ng-ext-link should simply replace it with target=_self
2012-04-12 02:36:03 -07:00
Igor Minar df72852f34 fix(e2eRunner): $browser.location should delegate to apps $location
previously it would create a new instance which wasn't configured as the one in the app,
which resulted in incorrect values being returned in html5 mode with base url set
2012-04-12 02:36:03 -07:00
simpulton c4f6ccb065 docs($compile): fixed typo 2012-04-11 23:48:53 -07:00
Igor Minar 0c49bbdc38 test(ngView): fix failing e2e tests 2012-04-11 21:27:55 -07:00
Igor Minar 7d074a3775 docs($http): fix return types 2012-04-11 17:29:16 -07:00
Igor Minar dceafd32ee feat($http): expose the defaults config as $http.defaults
Often it is impossible to set the http defaults during the config phase,
because the config info is not available at this time.

A good example is authentication - often the app needs to bootstrap,
allow user to enter credentials and only then it gains access to
session token which then should be sent to the server with every request.
Without having the ability to set the defaults at runtime, the developer
either has to resort to hacks, or has to set the session token header
with every request made by the app.
2012-04-11 17:29:16 -07:00
Thibault Leruitte 0a5050eb3c fix($location): don't rewrite links to different base paths
links to different base paths should not be left untouched
2012-04-11 17:27:32 -07:00
Vojta Jina 7c430c5ed0 chore(release scripts): group changelog only if more than 1 entry 2012-04-11 16:12:58 -07:00
Vojta Jina 93d62860e9 fix(input.radio): support 2-way binding in a repeater
Closes #869
2012-04-11 15:50:52 -07:00
Vojta Jina 5bcd719866 chore(ngSanitize): extract $sanitize, ngBindHtml, linkyFilter into a module
Create build for other modules as well (ngResource, ngCookies):
- wrap into a function
- add license
- add version

Breaks `$sanitize` service, `ngBindHtml` directive and `linky` filter were moved to the `ngSanitize` module. Apps that depend on any of these will need to load `angular-sanitize.js` and include `ngSanitize` in their dependency list: `var myApp = angular.module('myApp', ['ngSanitize']);`
2012-04-11 15:50:47 -07:00
Igor Minar e1743cc837 docs($compile): fix typo in the docs templateURL -> templateUrl 2012-04-11 11:23:48 -07:00
Igor Minar 52ee1ab5eb chore(*): remove dead code and fix code style issues 2012-04-10 16:52:12 -07:00
Vojta Jina fcc556df37 docs(guide.forms): fix the forms dev guide to use ng-disabled 2012-04-10 13:42:17 -07:00
Igor Minar 5c0ec9d06d docs(angular.bootstrap): fix typos and errors 2012-04-10 13:21:29 -07:00
Igor Minar ac2f0cece6 docs(tutorial): fix typos in steps 2 and 3 2012-04-10 06:04:13 -07:00
Igor Minar fbaa1968b7 chore($browser): remove the addJs method
this was never meant to be a public api used by apps. I refactored
the code to hide the functionality.

BREAKING CHANGE: $browser.addJs method was removed

apps that depended on this functionality should either use many of the
existing script loaders or create a simple helper method specific to the
app.
2012-04-09 17:59:47 -07:00
Igor Minar 13d5528a5f chore($browser): remove the addCss method
this api was never supposed to be public. nobody should be relying
on it.

I'm removing it since angular doesn't need it.

BREAKING CHANGE: $browser.addCss was removed

apps the depend on this functionality should write a simple utility
function specific to the app (see this diff for hints).
2012-04-09 15:21:46 -07:00
Igor Minar b5406d276d chore(ngBind): remove obsolete test
this test is not testing what it claims it is.

we don't need it any more
2012-04-09 11:49:51 -07:00
Igor Minar 0f89383d98 chore(tests): rename all directive names to the normalized form 2012-04-09 11:48:54 -07:00
Igor Minar 10daefc6f4 fix(ngBindHtml): clear contents when model is falsy
Closes #864
2012-04-09 09:52:28 -07:00
Igor Minar dc7b764d4d test(ngBindSpec): correct tests + split them up 2012-04-09 09:52:28 -07:00
Igor Minar 82d90a4096 fix(docs): change all directive references to use the normalized names 2012-04-09 09:52:27 -07:00
Igor Minar 7468bcb80b chore(release): starting 1.0.0rc5 reality-distortion iteration 2012-04-09 08:59:31 -07:00
Igor Minar bd4a4d390c chore(release): cutting the 1.0.0rc4 insomnia-induction release 2012-04-05 11:46:36 -07:00
Igor Minar 94fca76a08 docs(changelog): release notes for 1.0.0rc4 insomnia-induction 2012-04-05 11:45:34 -07:00
Igor Minar 1c8c083404 fix(docs): move $cookies and $cookieStore docs to module 2012-04-05 11:33:42 -07:00
Igor Minar 0f2de12273 chore(docs): add nonminified jquery debug version of docs 2012-04-05 11:33:42 -07:00
Igor Minar 1bbc67ef6c chore(Rakefile): fix and improve file rewriting code 2012-04-05 10:22:27 -07:00
Igor Minar 637817e3ba fix(Rakefile): move 'use strict'; flag into the angular closure
closure compiler is stubborn and puts the flag to the top of the file, so
we have to post-process the minified file to move the flag into the angular
closure.
2012-04-05 10:22:27 -07:00
Vojta Jina 86182a9415 feat($http): add withCredentials config option 2012-04-04 16:13:02 -07:00
Igor Minar 15ecc6f366 feat($route): allow chaining of whens and otherwise
Previously one had to write:

$routeProvider.when('/foo', {...});
$routeProvider.when('/bar', {...});
$routeProvider.otherwise({...});

After this change it's just:

$routeProvider.
    when('/foo', {...}).
    when('/bar', {...}).
    otherwise({...});

Breaks #when which used to return the route definition object but now
returns self. Returning the route definition object is not very useful
so its likely that nobody ever used it.
2012-04-04 16:10:44 -07:00
Igor Minar 53b2254ea7 docs(tutorial): update tutorial intro + steps 0-3
also contains all kinds of fixes that I had to make in the docs app to
get the tutorial to render correctly
2012-04-04 15:59:18 -07:00
Igor Minar 6336b6e89e chore(docs): restore old tutorial ngdoc files 2012-04-04 15:59:18 -07:00
Igor Minar fdf17d729f fix(docs): remove ngModelInstant from all examples
just fixing leftover code after the removal of ngModelInstant
2012-04-04 15:56:15 -07:00
Vojta Jina 85776c0d37 refactor(ngHref, ngSrc): remove duplicate tests 2012-04-04 15:01:27 -07:00
Vojta Jina 02cf958a07 chore(directive): correct file names for booleanAttrs 2012-04-04 14:58:27 -07:00
Vojta Jina 8fe4295a06 refactor(ngInclude): correct the tests 2012-04-04 14:58:07 -07:00
Vojta Jina dcb8e0767f fix(booleanAttrs): convert to boolean
jQuery's attr() does not handle 0 as false, when it comes to boolean attrs.
2012-04-04 08:26:28 -07:00
Misko Hevery 21b77ad5c2 fix(form): preperly clean up when invalid widget is removed
Removing invalid widget sometimes resulted in improper cleanup of the form state.
2012-04-03 23:28:05 -07:00
Misko Hevery 2f5dba488e fix(ng-href): copy even if no binding
Closes# 850

fixed an issue where ng-href would not copy its content into href if it did not contain binding.
2012-04-03 16:02:20 -07:00
Misko Hevery 7e86eacf30 fix($compile): relax the restriction that directives can not add siblings
Relax the restriction that directives can not add siblings
2012-04-03 16:02:20 -07:00
Vojta Jina 15c1fe3929 refactor(ngView): remove extra $watch, refactor one ugly test 2012-04-03 10:10:44 -07:00
Vojta Jina 428f2b5636 feat(ngInclude): allow ngInclude on css class
And make it terminal so that it does not compile its content, which would cause leaks.
2012-04-03 10:10:44 -07:00
Vojta Jina 199ac26986 fix(ngInclude): fire $includeContentLoaded on proper (child) scope 2012-04-03 10:10:44 -07:00
Vojta Jina 5f70d615a5 refactor(ngInclude): remove scope attribute
The purpose of allowing the scope to be specified was to enable the $route service to work
together with ngInclude. However the functionality of creating scopes was in the recent past
moved from the $route service to the ngView directive, so currently there is no valid use case
for specifying the scope for ngInclude. In fact, allowing the scope to be defined can under
certain circumstances lead to memory leaks.

Breaks ngInclude does not have scope attribute anymore.
2012-04-03 10:10:44 -07:00
Vojta Jina 06d0955074 feat(ngModel): update model on each key stroke (revert ngModelInstant)
It turns out that listening only on "blur" event is not sufficient in many scenarios,
especially when you use form validation you always had to use ngModelnstant
e.g. if you want to disable a button based on valid/invalid form.

The feedback we got from our apps as well as external apps is that the
ngModelInstant should be the default.

In the future we might provide alternative ways of suppressing updates
on each key stroke, but it's not going to be the default behavior.

Apps already using the ngModelInstant can safely remove it from their
templates. Input fields without ngModelInstant directive will start propagating
the input changes into the model on each key stroke.
2012-04-03 10:10:44 -07:00
Vojta Jina a22e0699be feat($sniffer): add hasEvent method for sniffing events
Skip changelog
2012-04-03 10:10:44 -07:00
Brad Green 28ff7c3a66 Doc fixes in bootstrap
Now makes sense.
2012-04-03 07:07:49 -07:00
Mykhailo Kotsur 59ae8adb3c fix(scenario): dev secenario tests
closes #843

Fixed failed e2e test
2012-04-02 16:10:15 -07:00
Igor Minar c0b78478a0 fix($q): $q.reject should forward callbacks if missing
$q.reject('some reason').then() should not blow up, but correctly
forward the callbacks instead.

Closes #845
2012-04-02 10:14:04 -07:00
Mykhailo Kotsur 59fa40ec0e fix($location): search setter should not double-encode the value
By mistake both the setter and helper function that composes the whole
url were encoding the search values.

Closes #751
2012-04-02 08:35:30 -07:00
Igor Minar a1f7f5d4d0 chore(release): start 1.0.0rc4 insomnia-induction iteration 2012-03-30 13:23:36 -07:00
Igor Minar 20687aa5f6 chore(release): cutting 1.0.0rc3 barefoot-telepathy 2012-03-29 16:10:40 -07:00
Igor Minar fc52b81d52 fix(docs): update the example widget regexp for detecting angular.js url
so that we don't show angular-cookies instead of angular.js
2012-03-29 16:10:40 -07:00
Igor Minar ae1aee2b6c fix(FormController): ask for dependency to fool the BC module 2012-03-29 16:10:40 -07:00
Igor Minar 423242017e fix(docs): properly rewrite urls in doc examples at docs-next 2012-03-29 16:10:40 -07:00
Vojta Jina 95c5df5958 fix(ngValue): bind properly inside ng-repeat 2012-03-29 14:05:19 -07:00
Igor Minar 2cb907a836 fix($injector): properly infer dependencies from fn with no args
Previously if there was a white-space in fn: fn( ) {} we failed to infer no args.

This was originally reported by recht, but I decided to use a different fix.

Closes #829
2012-03-29 11:21:04 -07:00
Igor Minar 2f2fd465a4 docs(changelog): release notes for 1.0.0rc3 barefoot-telepathy 2012-03-29 08:10:28 -07:00
Vojta Jina 6da355c3e1 refactor($compile): move methods of attr object into prototype
We have many instances of this object and we clone them as well (e.g. ng-repeat).
This should save some memory and performance as well.

Double prefixed private properties of attr object:
attr.$element -> attr.$$element
attr.$observers -> attr.$$observers

Update shallowCopy to not copy $$ properties and allow passing optional destination object.
2012-03-29 07:30:32 -07:00
Vojta Jina f2106692b1 fix($compile): properly clone attr.$observers in ng-repeat
The `attr` object was only shallow copied which caused all observers to be shared.
Fixing similar issue in ng-* boolean attributes as well as ng-src and ng-href.
2012-03-29 07:30:32 -07:00
Vojta Jina 4557881cf8 chore(release scripts): auto release scripts 2012-03-29 07:22:13 -07:00
Igor Minar af0ad6561c refactor(fromJson/toJson): move the contents of these files into Angular.js
these files are now mostly empty so it doesn't make sense to keep them
separated from other helper functions
2012-03-28 16:57:34 -07:00
Igor Minar 35125d2513 refactor(toJson): use native JSON.stringify
Instead of using our custom serializer we now use the native one and
use the replacer function to customize the serialization to preserve
most of the previous behavior (ignore $ and $$ properties as well
as window, document and scope instances).
2012-03-28 16:57:22 -07:00
Igor Minar 87f5c6e5b7 refactor(fromJson): always use native JSON.parse
This breaks IE7 for which you can use polyfill:

https://github.com/douglascrockford/JSON-js

<!--[if lt IE 8]>
<script src="json2.min.js"></script>
<![endif]-->

or

http://bestiejs.github.com/json3/

<!--[if lt IE 8]>
<script src="json3.min.js"></script>
<![endif]-->
2012-03-28 16:30:38 -07:00
Igor Minar a8a750ab05 feat($http): make the transform defaults to an array
$httpProvider.defaults.transformRequest and $httpProvider.defaults.transformResponse
are now arrays containing single function. This makes it easy to add an
extra transform fn.

adding an extra fn before had to be done in this cluncky way:

$httpProvider.defaults.transformResponse =
[$httpProvider.defaults.transformResponse, myTransformFn];

after this change, it's simply:

$httpProvider.defaults.transformResponse.push(myTransformFn);
2012-03-28 16:30:38 -07:00
Igor Minar 13a95ae499 style($http): remove redundant 'use strict' header 2012-03-28 16:30:31 -07:00
Igor Minar da9f4dfcf4 feat(TzDate): add support for toISOString method 2012-03-28 16:30:31 -07:00
Igor Minar ac4318a2fa refactor(fromJson/date filter): move date string logic to date filter
Breaks angular.fromJson which doesn't deserialize date strings into date objects.

This was done to make fromJson compatible with JSON.parse.

If you do require the old behavior - if at all neeeded then because of
json deserialization of XHR responses - then please create a custom
$http transform:

$httpProvider.defaults.transformResponse.push(function(data) {
  // recursively parse dates from data object here
  // see code removed in this diff for hints
});

Closes #202
2012-03-28 16:30:30 -07:00
Misko Hevery bb2fa6f63f fix(i18n e2e tests): 2012-03-28 11:24:47 -07:00
Igor Minar ba59ef4950 docs(examples): update example apps 2012-03-28 11:24:47 -07:00
Igor Minar 8b93541522 style(Rakefile): use snake_case in ruby code 2012-03-28 11:16:36 -07:00
Misko Hevery 7b22d59b4a chore(ngCookies): moved to module 2012-03-28 11:16:36 -07:00
Misko Hevery 798bca62c6 chore(resource): moved to module 2012-03-28 11:16:36 -07:00
Misko Hevery 8218c4b60b chore(Rakefile): get ready for modules 2012-03-28 11:16:36 -07:00
Misko Hevery 2430f52bb9 chore(module): move files around in preparation for more modules 2012-03-28 11:16:35 -07:00
Brad Green 944098a4e0 Updated manual bootstrap document
Explained why you'd want to manually bootstrap, added contrasting
example for automatic vs manual methods.
2012-03-27 18:06:00 -07:00
Brad Green 2ce0485e6f Rewrite of Automatic Initialization doc
Added examples, explained the reasons why you initialize the whole app
or parts of the page.
2012-03-27 08:28:34 -07:00
Vojta Jina a08cbc02e7 feat($compile): do not interpolate boolean attributes, rather evaluate them
So that we can have non string values, e.g. ng-value="true" for radio inputs

Breaks boolean attrs are evaluated rather than interpolated

To migrate your code, change: <input ng-disabled="{{someBooleanVariable}}">
to: <input ng-disabled="someBooleanVariabla">


Affected directives:

* ng-multiple
* ng-selected
* ng-checked
* ng-disabled
* ng-readonly
* ng-required
2012-03-26 21:14:09 -07:00
Vojta Jina 55027132f3 refactor(ngBindAttr): remove
Breaks ng-bind-attr directive removed
2012-03-26 21:14:09 -07:00
Vojta Jina 09e175f02c feat(ngValue): allow radio inputs to have non string values
Closes #816
2012-03-26 21:14:09 -07:00
Mykhailo Kotsur 5c5b1183c8 docs(guide/module): fix syntax error and expectation in test example 2012-03-26 16:06:46 -07:00
Mykhailo Kotsur f04142ea28 docs(guide/unit-testing): fixed typo in code example 2012-03-26 16:06:16 -07:00
Igor Minar aaedefb92e refactor($sniffer): make $sniffer service private
This service has been accidentaly documented in the past, it should not be considered
to be public api.

I'm also removing fallback to Modernizr since we don't need it.

Breaks any app that depends on this service and its fallback to Modernizr, please
migrate to custom "Modernizr" service:

    module.value('Modernizr', function() { return Modernizr; });
2012-03-26 15:43:59 -07:00
Igor Minar d54dfecb00 feat($controller): support controller registration via $controllerProvider
It's now possible to register controllers as:

.register('MyCtrl', function($scope) { ... });
// or
.register('MyCtrl', ['$scope', function($scope) { ... });

Additionally a module loader shortcut api was added as well:

myModule.controller('MyCtr', function($scope) { ... });
2012-03-26 15:23:29 -07:00
Igor Minar 4b8d926062 feat(assertArgFn): should support array annotated fns 2012-03-26 12:21:42 -07:00
Igor Minar 74c84501ed doc(guide/module): fix typo 2012-03-23 16:57:24 -07:00
Igor Minar 4581b79bbd doc(guide/controller): fix examples 2012-03-23 16:54:48 -07:00
Manuel Woelker 2be8847ef6 doc(guide): order topic list in guide sidebar in accordance with overview
Closes #405
2012-03-23 16:31:33 -07:00
Igor Minar cb2ad9abf2 fix(init): use jQuery#ready for init if available
Closes #818
2012-03-23 15:41:37 -07:00
Misko Hevery 73c8593077 feat(http): added params parameter
The params parameter can now be used to serialize parameters in the URLs. The serialization does proper escaping and JSON encoding if it is an object.
2012-03-23 14:21:43 -07:00
Misko Hevery ac75079e21 fix(q): resolve all of nothing to nothing
$q.all([]) no longer throws exception and resolves to empty array []
2012-03-23 14:21:43 -07:00
Igor Minar 5390fb37d2 fix($compile): create new (isolate) scopes for directives on root elements
previously we would not create them and it's causing all kinds of issues and accidental leaks

Closes #817
2012-03-23 11:46:54 -07:00
Igor Minar 8d7e694849 fix(forEach): should ignore prototypically inherited properties
Closes #813
2012-03-22 16:39:36 -07:00
Igor Minar 5fdab52dd7 feat(jqLite): make injector() and scope() work with the document object
For typical app that has ng-app directive on the html element, we now can do:

angular.element(document).injector() or .injector()
angular.element(document).scope() or .scope()

instead of:

angular.element(document.getElementsByTagName('html')[0]).injector()
...
2012-03-22 16:39:36 -07:00
Vojta Jina 541bedd1a9 refactor(ngController): remove unused deps 2012-03-22 16:29:31 -07:00
Igor Minar 98e18a64aa docs(cookbook/form): fix the example
Closes #712
2012-03-21 13:52:11 -07:00
Igor Minar 0a45bff472 chore(docs): switch disqus id from angularjs to angularjs-next 2012-03-21 13:46:35 -07:00
Igor Minar 263524d381 docs(changelog): fix rc2 release date 2012-03-20 17:21:41 -07:00
Igor Minar 52c59cf0ce chore(release): start 1.0.0rc barefoot-telepathy iteration 2012-03-20 16:02:49 -07:00
Igor Minar c5f8edfe03 chore(release): cutting the 1.0.0rc2 silence-absorption release 2012-03-20 15:38:57 -07:00
Igor Minar 69f0aa899d docs(changelog): release notes for 1.0.0rc2 silence-absorption 2012-03-20 15:25:31 -07:00
Daniel Zen e7cd0bcc5a docs(guide/controllers): add a section on testing controllers 2012-03-20 15:23:58 -07:00
Vojta Jina ade6c45275 feat(input.radio): Allow value attribute to be interpolated 2012-03-20 14:39:23 -07:00
Igor Minar 9eafd10fcd docs(guide/location): fix example 2012-03-20 12:05:57 -07:00
Igor Minar 3436c027f2 docs(guide/started): fix examples 2012-03-20 11:30:21 -07:00
Igor Minar 6a8749e65a refactor($resource): unify and simplify the code 2012-03-20 11:07:38 -07:00
Igor Minar 1a5bebd927 fix($http): don't send Content-Type header when no data
When a http request has no data (body), we should not send the
Content-Type header as it causes problems for some server-side
frameworks.

Closes #749
2012-03-20 11:07:38 -07:00
Igor Minar 83155e8fbe style(ResourceSpec): style clean up 2012-03-20 11:07:37 -07:00
Igor Minar 6d6f875345 fix($resource): support escaping of ':' in resource url
So one can how define cors/jsonp resources with port number as:

resource.route('http://localhost\\:8080/Path')
2012-03-20 11:07:37 -07:00
Igor Minar a4fe51da3b feat($route): when matching consider trailing slash as optional
This makes for a much more flexible route matching:

- route /foo matches /foo and redirects /foo/ to /foo
- route /bar/ matches /bar/ and redirects /bar to /bar/

Closes #784
2012-03-20 11:07:37 -07:00
Igor Minar ee5a5352fd fix(e2e runner): fix typo that caused errors on IE8
Closes #806
2012-03-20 11:07:37 -07:00
Igor Minar 9cb2195e61 fix($compile): don't touch static element attributes
Compiler should not reassign values to element attributes if its not neccessary due
to interpolation or special attribute magic (ng-src -> src)

This resolves several issues on IE caused by reassigning script.src attribute which
caused all of the scripts to be reloaded.
2012-03-20 11:07:36 -07:00
Igor Minar 15213ec212 fix($log): avoid console.log.apply calls in IE
In IE window.console.log and friends are functions that don't have apply or call fns.

For this reason we have to treat them specially and do our best to log at least
something when running in this browser.

Closes #805
2012-03-20 11:07:36 -07:00
Igor Minar 9171c76bb4 style($log): reformat code for readability 2012-03-20 11:07:35 -07:00
Igor Minar 64fb1f2620 docs(filters): use ng-model-instant in live examples
Closes #807
2012-03-20 11:07:35 -07:00
Vojta Jina f49eaf8bf2 fix($compile): Merge interpolated css class when replacing an element 2012-03-20 10:39:43 -07:00
Vojta Jina f701ce08f9 fix(matchers.toHaveClass): Correct reference to angular.mock.dump 2012-03-19 17:26:29 -07:00
Misko Hevery 1cc0e4173d bug(ie7): incorrectly set all inputs to disabled
In ie7 all of the input fields are set to readonly and disabled, because ie7 enumerates over all attributes even if the are not declared on the element.
2012-03-19 15:49:42 -07:00
Misko Hevery d4ae7988da chore(parseInt): cleanup parseInt() for our int() 2012-03-19 11:41:23 -07:00
Misko Hevery 5ac14f633a fix(json): added support for iso8061 timezone
Added support of timezone in dates not just zulu timezone.

This fixes issues for date filter which uses json deserialization under the hood. (for now)

Closes #/800
2012-03-19 11:41:10 -07:00
Misko Hevery 9918b748be fix(compiler): allow transclusion of root elements
Fixed an issue where a directive that uses transclusion (such as ngRepeat) failed to link if it was declared on the root element of the compilation tree. (For example ngView or ngInclude including template where ngRepeat was the top most element).
2012-03-19 11:35:10 -07:00
Misko Hevery 6ecac8e71a fix(select): multiselect failes to update view on selection insert
In multiselect when the underlying selection array push/pops an element the view did not re-render since the array reference stayed the same.
2012-03-19 11:35:10 -07:00
Misko Hevery 823adb2319 fix(ngForm): alias name||ngForm
form directive was requiring name attribute even when invoked as attribute, resulting in unnecessary duplication
2012-03-19 11:35:09 -07:00
Misko Hevery 21e74c2d2e fix(ngView): controller not published
corrected omitted assignment of controller to the element data object. Without this fix the controller created by ngView is not accessible from the browser debugger.
2012-03-19 11:35:09 -07:00
Misko Hevery 6c5a05ad49 feat(jqLite): add .controller() method
extend JQuery with .controller() method which retrieves the closest controller for a given element
2012-03-19 11:35:09 -07:00
Vojta Jina 192ff61f5d feat(scope.$eval): Allow passing locals to the expression 2012-03-18 23:46:30 -07:00
Igor Minar 935c1018da fix(ngRepeat): correct variable reference in error message
Closese #803
2012-03-17 15:57:55 -07:00
Igor Minar 78a6291666 docs(scope): add $destroy event docs 2012-03-16 15:32:14 -07:00
Igor Minar 53b6f522a5 fix(ngDocSpec): fix broken tests 2012-03-16 15:32:14 -07:00
Vojta Jina 1faafa3158 fix(forms): Remove double registering of form 2012-03-16 12:06:29 -07:00
Vojta Jina 08bfea183a fix(forms): Set ng-valid/ng-invalid correctly 2012-03-16 12:06:29 -07:00
Igor Minar f13dd3393d feat(injector): infer _foo_ as foo
this is to enable nicer tests:

 describe('fooSvc', function() {
   var fooSvc;

   beforeEach(inject(function(_fooSvc_) {
     fooSvc = _fooSvc_;
   }));

   it('should do this thing', function() {
     //test fooSvc
   });
 });
2012-03-16 10:52:40 -07:00
Igor Minar bca96e7c7c style(ngViewSpec): pretify some tests with $destroy events 2012-03-16 10:52:40 -07:00
Igor Minar 9b1aff905b feat(scope): broadcast $destroy event on scope destruction
perf testing shows that in chrome this change adds 5-15% overhead
when destroying 10k nested scopes where each scope has a $destroy listener
2012-03-16 09:41:05 -07:00
Igor Minar 252d4548f9 style(ngSwitchSpec): fix typo 2012-03-15 15:23:49 -07:00
Igor Minar 6abafcb424 docs(changelog): fix broken links
Closes #793
2012-03-15 10:19:44 -07:00
Igor Minar 2315d9b361 fix(ng-switch): properly destroy child scopes 2012-03-14 14:33:20 -07:00
Igor Minar 8fd1b74872 chore(release): start the 1.0.0rc2 silence-absorption iteration 2012-03-14 13:45:44 -07:00
alkis 02091b2c1e style(changelog): Fix some typos 2012-03-14 10:13:03 -07:00
Igor Minar 25cd774abf chore(release): cutting 1.0.0rc1 moiré-vision 2012-03-14 01:00:46 -07:00
Igor Minar c70ead0aa1 fix(Rakefile): version.dot extractor should ignore 'rc1' 2012-03-13 23:24:17 -07:00
Igor Minar 716b5fd3e2 docs(*): fixing various docs 2012-03-13 23:17:43 -07:00
Misko Hevery 8b8fdddc0b docs(links): corrected borken links 2012-03-13 19:36:09 -07:00
Igor Minar ce4b630524 fix(docs): properly close the optional ] in directive signatures 2012-03-13 17:51:05 -07:00
Vojta Jina 13f31602f3 feat(ng-list): Allow custom separator 2012-03-13 17:51:05 -07:00
Daniel Zen 7b52586f7c docs(guide): fix non-working example + add docs for implicit DI 2012-03-13 17:14:50 -07:00
Misko Hevery e9e3ee012b feat(compile): allow ngForm on attribute and class
#feature
- ngForm directive can now be used with element, class, and attributes
2012-03-13 16:59:10 -07:00
Misko Hevery de9464c143 f(compile): boolean attributes too agresive
- compiler would rewrite boolean attributes on all elements. This is too aggressive and interferes with some third-party frameworks
2012-03-13 16:59:03 -07:00
Misko Hevery 31cd580310 fix(ng-non-bindable): increase priority to 1000
- increase ng-non-bindable prioirity to 1000 so that it prevents attribute interpolation on same level.
2012-03-13 16:58:36 -07:00
Misko Hevery d34f3bc7a6 feat(form): publish validationErrorKeys as CSS
- The validationErrorKeys are now published as CSS for easy styling. The errorKeys should be in
 camelCase and the CSS will be in snake-case
2012-03-13 16:57:36 -07:00
Misko Hevery 027801a00a doc(search): include method names in corpus 2012-03-13 16:32:15 -07:00
Vojta Jina 66e6c1ce2c docs(forms): Change validation tokens to lowercase 2012-03-13 16:18:14 -07:00
Igor Minar 4806d28a29 fix(forms): remove control.$form and use nullFormCtrl 2012-03-13 16:05:52 -07:00
Igor Minar 089c0f8b0e fix(forms): fix nesting issues and add tests 2012-03-13 16:05:52 -07:00
Igor Minar b6ae6e52f9 fix(indexOf): use native impl if available 2012-03-13 14:13:53 -07:00
Igor Minar 9277d12fc0 fix(forms): lowercase all validation error keys 2012-03-13 14:13:53 -07:00
Igor Minar ac5151a469 fix(scope): remove scope $destroy event 2012-03-13 14:13:53 -07:00
Vojta Jina 63be222326 docs(input): Fix some broken links, add missing $, use ng- in examples 2012-03-13 13:52:57 -07:00
Vojta Jina a29c2cf70c doc(form): updated to reflect the latest changes 2012-03-13 13:36:28 -07:00
Igor Minar afe617a647 docs(*): renaming incorrect widget references to control or directive 2012-03-12 23:04:12 -07:00
Igor Minar f59e4b11f1 fix(forms): prefix all form and control properties with $ 2012-03-12 23:04:11 -07:00
Igor Minar 5e6ba25201 fix(forms): remove the need for extra form scope
the forms/controls code refactored not to depend on events which forced
us to create new scope for each form element.
2012-03-12 23:04:11 -07:00
Igor Minar 9134f5ce5a style(ng-include): remove unused args 2012-03-12 23:04:11 -07:00
Igor Minar 4e6b065a2f test(ng-include): add ng-include=src test 2012-03-12 23:04:11 -07:00
Igor Minar 5e3db61b1d docs(release): release notes for 1.0.0rc1 2012-03-12 23:04:11 -07:00
Igor Minar a9ed5745a0 docs(directive): add more docs for the directive api 2012-03-12 23:04:10 -07:00
Misko Hevery 48096048cf fix(svg): normalize class access for SVG 2012-03-12 21:59:50 -07:00
Vojta Jina 317adb36a4 docs(guide.forms): Update forms guide 2012-03-12 01:40:12 -07:00
Vojta Jina 1b9277bf6f fix(forms): Propagate change from model even if it's undefined 2012-03-12 01:40:12 -07:00
Misko Hevery cce31d4c93 chore(ng-include): update to work in ng-include|src mode 2012-03-11 22:36:29 -07:00
Misko Hevery 3e5377f4f3 doc(fixes): to better support ng-directive notation 2012-03-11 21:31:35 -07:00
Misko Hevery 488a03631e Mostly Revert "fix(docs): directive events + cleanup"
This reverts commit 8fb34f008e.
2012-03-11 21:31:34 -07:00
Vojta Jina 716dd5f3f9 refactor(forms): Remove touch() method 2012-03-09 17:33:22 -08:00
Vojta Jina 83314913e7 refactor(forms): Rename read() -> setViewValue() 2012-03-09 17:33:22 -08:00
Igor Minar e0cc84ad7b docs(directives): set directive param name to directive name
so that we can render better usage examples in docs
2012-03-09 16:27:12 -08:00
Igor Minar 4a94bb9b34 fix(startTag): fix tagname extraction
the original code magically worked for ng:foo but for nothing else
2012-03-09 16:27:12 -08:00
Igor Minar 53aacb35fa chore(shiv): remove obsolete shiv code
we can't provide this functionality because the directives are lazy
loaded when the module loads, which is too late for the shiv to do
anything useful.
2012-03-09 16:14:26 -08:00
Igor Minar f4d338d393 chore(*): refactor all ng: to ng- 2012-03-09 16:14:26 -08:00
Vojta Jina 0bfaa579c0 feat($provide.service): Add $provide.service() for registering a class 2012-03-09 10:10:29 -08:00
Vojta Jina 00d4427388 refactor($provide) Rename service -> provider
It registers a provider class, so this makes more sense.

Breaks Rename $provide.service -> $provide.provider
2012-03-09 10:10:28 -08:00
Vojta Jina e0c9551fd7 refactor(forms): remove registerWidget and use event instead
Each widget (ng-model directive) emits $newFormControl event instead of getting hold of parent form
and calling form.registerWidget(this);
2012-03-09 10:10:28 -08:00
Igor Minar fae84463e4 docs(css): allow headers to wrap with blue background 2012-03-08 22:29:35 -08:00
Igor Minar 8fb34f008e fix(docs): directive events + cleanup 2012-03-08 22:29:35 -08:00
Igor Minar 5d09a1efd3 fix(ng-view, ng-include): onload and $contentLoaded
- change custom onload directive to special arguments recongnized by both
  ng-view and ng-include
- rename $contentLoaded event to $viewContentLoaded and $includeContentLoaded
- add event docs
2012-03-08 22:29:35 -08:00
Igor Minar f54db2ccda chore(directives,widgets): reorg the code under directive/ dir 2012-03-08 22:29:34 -08:00
Misko Hevery dd7b0f56fc fix(ng-cloak): work with class 2012-03-08 16:30:39 -08:00
Vojta Jina b3750103cc fix($parse): Allow property names that collide with native object properties
I.e. constructor, toString, or watch on FF
(https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/watch)

+ optimize parser a bit to not create getter function for operators
2012-03-08 11:39:03 -08:00
Vojta Jina b348347dad refactor(fromJson): Remove error() and just throw
It's more likely you are using angular.fromJson() inside Angular world, which means you get proper
exception handling by $exceptionHandler.

There is no point to explicitly push it to console and it causes memory leaks on most browsers 
(tried Chrome stable/canary, Safari, FF).
2012-03-08 11:38:14 -08:00
Igor Minar 512db03cc0 docs(ng-list): update the ng-list directive docs 2012-03-08 11:06:15 -08:00
Igor Minar ee7209fe26 fix(tests): fix name collisions between various tests 2012-03-08 11:06:15 -08:00
Igor Minar 772ddb983b docs(directive, module): add various missing docs and fix existing docs 2012-03-08 11:06:14 -08:00
Igor Minar 7f6c1093f5 docs(ng-view): improve the ng-view docs 2012-03-08 11:06:14 -08:00
Igor Minar 1b4289ce76 fix(docs): add a header for the directive info section 2012-03-08 11:06:14 -08:00
Igor Minar af21233820 fix(test): rename an it so that it doesn't colide with the test above 2012-03-08 11:06:14 -08:00
Igor Minar 08ad4b6a46 docs(jqlite): add docs for wrap() 2012-03-08 11:06:14 -08:00
Igor Minar 2acd60df4d fix(docs): remove undefined from examples with jsfiddle=false 2012-03-08 11:06:14 -08:00
Igor Minar e0ace15cd3 docs($rootScope): rename ttl to digestTtl + docs 2012-03-08 11:01:22 -08:00
Misko Hevery 6a98c52c84 chore(compiler): change default restriction to attribute only for directives 2012-03-08 10:07:49 -08:00
Vojta Jina 6aa3cfc31b docs($compileProvider.directive): Update iAttrs docs 2012-03-07 14:04:14 -08:00
Vojta Jina 64912069ca docs(mock.inject): Fix the example
And explicitly say that you need to load your application modules that you wanna test.
2012-03-05 19:28:03 -08:00
Vojta Jina b49ddf9848 docs($route, ng:view): Fix the examples to work on jsfiddle, update docs 2012-03-05 19:15:18 -08:00
Vojta Jina 1084ccf7ef fix(docs): Add $locationProvider methods to the docs example provider
- $locationProvider.html5Mode
- $locationProvider.hashPrefix

Docs example is basically a different application on the same page, but we don't want to instantiate multiple instances of $browser or $location service, so we are overriding these providers to return the instances from parent app.

Overriding the service with $provide.value caused a provider to be auto-generated without the necessary hashPrefix and html5Mode apis.
2012-03-05 19:09:43 -08:00
Vojta Jina c2989f6cc6 fix(ng-include): Compile only content 2012-03-05 10:41:59 -08:00
Vojta Jina 4f797fe5f3 refactor(testabilityPatch): Change JSTD fail to more general throw
"fail" is a JSTD specific API, so it's not defined when testing without JSTD (eg SlimJim).
2012-03-05 10:41:51 -08:00
Vojta Jina bbd3a3fd76 chore: Update slim-jim 2012-03-05 09:59:29 -08:00
Stephane Bisson e86bafecd2 fix(mock.TzDate): getDay() takes into account the timezone offset 2012-02-29 15:53:51 -08:00
Marcello Nuccio e68c02c537 docs($cacheFactory): Correct method's description 2012-02-29 15:48:37 -08:00
Marcello Nuccio 25d207c48c docs($injector): Correct provider suffix to "Provider" 2012-02-29 15:46:55 -08:00
Vojta Jina 4370d756e4 refactor(directive.ngModel): rename emitValidity -> setValidity 2012-02-28 18:22:41 -08:00
Vojta Jina 4e83399570 fix(ng:model-instant): defer only keydown, throttle setTimeouts 2012-02-28 18:22:41 -08:00
Vojta Jina e7d6106811 fix(input): Render 0 (number) as 0 (not empty string) 2012-02-28 18:22:41 -08:00
Vojta Jina c4c60c25b4 reafactor: Rename ng:bind-immediate -> ng:model-instant 2012-02-28 18:22:41 -08:00
Vojta Jina 139e1b09a9 docs(forms): Update API docs for forms
- API forms (ng:model + controller, form + controller)
- fix some broken links
- ng:change, ng:model-instant
2012-02-28 18:22:35 -08:00
Vojta Jina 60743fc52a feat(ng:include) Fire $contentLoaded event
+ refactor unload to listen on this event -> we can use unload with ng:view as well

Closes #743
2012-02-28 17:48:07 -08:00
Vojta Jina 9486590e1b refactor(ng:view) Make $route scope agnostic, add $contentLoaded event
Problems:

- controller was instantiated immediately on $afterRouteChange (even if no content), that's
different compare to ng:controller, which instantiates controllers after compiling
- route listened on current scope ($afterRouteChange), so if you were listening on $rootScope
($afterRouteChange), you get called first and current.scope === undefined, which is flaky
- route handles scope destroying, but scope is created by ng:view
- route fires after/before route change even if there is no route (when no otherwise specified)

Solution:

- route has no idea about scope, whole scope business moved to ng:view (creating/destroying)
- scope is created (and controller instantiated) AFTER compiling the content
- that means on $afterRouteChange - there is no scope yet (current.scope === undefined)
- added $contentLoaded event fired by ng:view, after linking the content
2012-02-28 17:46:58 -08:00
Misko Hevery e31d1c287d refactor($route): remove .parent(); ng:view scope creation 2012-02-28 17:46:58 -08:00
Misko Hevery f16bd2f747 refactor($route): move when/otherwise to provider 2012-02-28 17:46:58 -08:00
Misko Hevery ef7346ff70 docs(scope): correct formatting 2012-02-28 17:46:58 -08:00
Misko Hevery f6fb31e8ad chore(ng:view): simplify, by taking advantage of new compiler features 2012-02-28 17:46:58 -08:00
Vojta Jina 21c725f1a1 refactor(forms): Even better forms
- remove $formFactory completely
- remove parallel scope hierarchy (forms, widgets)
- use new compiler features (widgets, forms are controllers)
- any directive can add formatter/parser (validators, convertors)

Breaks no custom input types
Breaks removed integer input type
Breaks remove list input type (ng-list directive instead)
Breaks inputs bind only blur event by default (added ng:bind-change directive)
2012-02-28 17:46:58 -08:00
Vojta Jina e23fa768aa docs(directive.script): Subtle update to API docs 2012-02-28 17:41:37 -08:00
Vojta Jina d656d11489 feat(directive.style): Do not compile content of style element 2012-02-28 17:41:30 -08:00
Vojta Jina b37e8a2b14 docs(directive.script): Add simple example of inlined template 2012-02-28 14:15:44 -08:00
Vojta Jina 4c1c50fd9b fix(directive.script): Do not compile content of script tags 2012-02-28 14:15:44 -08:00
Vojta Jina d1558d7924 docs: evaluate only scripts with type text/javascript 2012-02-28 14:15:39 -08:00
Vojta Jina 5b0d068358 fix($http): Do not serialize File object 2012-02-25 18:49:54 -08:00
Vojta Jina 230f29d0a7 fix(jqLite): set event's monkey patched methods to null (on IE7) 2012-02-23 23:41:41 -08:00
Vojta Jina 3171f21591 fix($httpBackend): Set current url, if not defined or empty string
Reason to fix this was the fact that with undefined url, it ended up with weird exception
(Cannot call method 'replace' of undefined), which was more confusing than helpful.

jQuery.ajax() does request to current url, if url is not specified, so I decided for this solution.
2012-02-23 22:50:02 -08:00
Misko Hevery d6e3e1baab feta(scope): watch object refference or equality
Breaks: Must set $watch equality to true for the old behavior
2012-02-23 15:01:08 -08:00
Misko Hevery ffa8441886 bug(equals): incorect comparison of dates 2012-02-23 13:57:28 -08:00
Misko Hevery 5d8528cc2e docs(module): Describe module loading 2012-02-23 09:53:14 -08:00
Misko Hevery 80edcadb1d feat($provide): added constant 2012-02-22 13:28:42 -08:00
Misko Hevery c27a56f4da docs(scope): show which directives create scopes 2012-02-22 12:59:23 -08:00
Misko Hevery fbcb7fdd14 fix($injector): circular dependency instatiation 2012-02-22 11:32:09 -08:00
Vojta Jina fa69d10122 docs(ng:app): Move to other directives namespace 2012-02-22 11:09:33 -08:00
Vojta Jina dd321c5f4d docs(scope): update $emit/$broadcast docs 2012-02-22 10:24:40 -08:00
Misko Hevery 656a495e50 refactor(directive): use attrs.$observe 2012-02-21 22:46:01 -08:00
Vojta Jina 6d0ca95fa0 feat($compiler): Allow attr.$observe() interpolated attrs 2012-02-21 22:46:01 -08:00
Misko Hevery 3df7b8e57f fix(ng:repeat): use transclusion 2012-02-21 22:46:01 -08:00
Misko Hevery 7bd69d0f5b chore(ng:switch): rewritten with transclusion API
BREAKING CHANGE: the change event fires on scope of switch not on scope of case.
2012-02-21 22:46:01 -08:00
Misko Hevery 3773323e46 docs($compile): transclude documentation 2012-02-21 22:46:01 -08:00
Misko Hevery 78656fe0df feat($compile) add locals, isolate scope, transclusion 2012-02-21 22:46:00 -08:00
Misko Hevery cb10ccc44f feat($compile): mark scope creation with ng-scope class 2012-02-21 22:46:00 -08:00
Misko Hevery 4a051efb89 feat($compile): support compiling text nodes by wrapping them in <span> 2012-02-21 22:46:00 -08:00
Misko Hevery 1752c8c44a feat(directive): event now accessible as $event
Closes 259
2012-02-21 22:46:00 -08:00
Misko Hevery 6216dc0465 chore(select): remove inherit, replace with expression locals 2012-02-21 22:45:59 -08:00
Misko Hevery 761b2ed85a feat(parse): add support for local vars in expressions 2012-02-21 22:45:59 -08:00
Misko Hevery c8ee631c19 feat(mouseenter/mouseleave): emulating ie events 2012-02-21 22:45:59 -08:00
Misko Hevery cae9ad4ba9 docs(decorator): add missing decorate docs 2012-02-21 22:45:59 -08:00
Misko Hevery 85b2084f57 fix(select): double array issue with multislect and jQuery 2012-02-21 22:45:59 -08:00
Misko Hevery 13b21aaf5a fix(doc): example was referring to non existent CSS 2012-02-21 22:45:59 -08:00
Misko Hevery 22c1db1744 fix(ngdoc): extract keywords from properties/methods. 2012-02-21 22:45:58 -08:00
Misko Hevery 292a5dae07 chore(slim-jim) add configuration 2012-02-21 22:45:58 -08:00
Vojta Jina 6e635012fb feat(scope): scope.$emit/$broadcast return the event object, add cancelled property 2012-02-21 10:58:48 -08:00
Misko Hevery eb92735c9e fix(injector) .instantiate([Type]) produced wrong result 2012-02-16 14:32:52 -08:00
Vojta Jina 776739299b fix($injector): instantiate returns instance, if non-object value returned from constructor 2012-02-08 16:12:11 -08:00
Vojta Jina 3173d8603d fix(jqLite): fix memory leaking in IE8 (remove monkey patched methods on Event)
These methods cause IE8 holds the whole jqLite in the memory, even when page is reloaded.
jqLite's cache keeps element's data (event handlers, attached scopes, injector, etc…), so almost all used memory is never released in IE8.

jQuery creates its own Event object (wrapper around native Event) instead.
2012-02-05 00:09:02 -08:00
Vojta Jina 6c4f1391bc refactor(test): remove odd inject from describe 2012-01-30 11:44:19 -08:00
Vojta Jina 58d6da556a refactor(binder): replace jested assertions with jasmine 2012-01-29 21:59:35 -08:00
Vojta Jina b6f61a89cf docs($compileProvider.directive): fix some typos 2012-01-26 09:13:08 -08:00
Igor Minar 8b32900d72 fix($parse): simplify getterFn 2012-01-25 16:52:39 -08:00
Igor Minar 18a1e860a3 fix($parse): small fixes
- typos
- dead code removal
- remove unneeded variable
2012-01-25 16:17:44 -08:00
Igor Minar 39b3297fc3 fix($parse): get rid of $unboundFn
Closes #731
2012-01-25 16:17:43 -08:00
Misko Hevery 1268fc1a44 cleanup($scope): remove $$scope ref. 2012-01-25 11:54:00 -08:00
Misko Hevery 4804c83b7d docs(compiler): update the compiler docs 2012-01-25 11:53:59 -08:00
Misko Hevery e2b1d9e994 feat(scriptTemplateLoader): provide template inlining
populates $templateCache with content of ng-template scripts
2012-01-25 11:50:37 -08:00
Misko Hevery 9ee2cdff44 refactor(directives): connect new compiler
- turn everything into a directive
2012-01-25 11:50:37 -08:00
Misko Hevery 8af4fde182 add($compile): add compiler v2.0 - not connected 2012-01-25 11:46:36 -08:00
Misko Hevery 5001c1a121 refactor($interpolate): improve interpolation service add documentation 2012-01-25 11:46:36 -08:00
Misko Hevery 0f6b2ef982 refactor(sanitizer): turn sanitizer into a service 2012-01-25 11:46:35 -08:00
Misko Hevery 1e258d11d0 feat(test): support it('should', pending); 2012-01-25 11:46:35 -08:00
Misko Hevery 81a6601e05 fix(docs): improper rendering of JSON 2012-01-25 11:46:35 -08:00
Igor Minar 1e96d0af8c fix(injector): small perf improvement & code cleanup 2012-01-25 11:46:35 -08:00
Misko Hevery 97dae0d0a0 feat(jqLite): add contents() 2012-01-25 11:46:35 -08:00
Misko Hevery 84823b2eff feature($exceptionHandler): $exceptionHandler now supports var_args 2012-01-25 11:46:34 -08:00
Misko Hevery 517811764d cleanup(tests): remove unused variables 2012-01-25 11:46:34 -08:00
Misko Hevery 1354718365 chore(jasmine-adapter): upgrade 2012-01-25 11:46:34 -08:00
Kai Groner 56bcc04c54 feat(ng:class): support using map of classnames and conditions
enables <div ng:class="{'hide': !visible, 'warning': isAlert()}"...
2012-01-24 10:28:29 -08:00
Igor Minar b2052d08a1 fix($parse): fixing typos in JS_KEYWORDS 2012-01-23 22:33:28 -08:00
Igor Minar 7da2bdb82a fix(scope): support watching functions
currently we run into infinite digest if a function is being
watched as an expression. This is because we generate bound
function wrapper when the watch is processed via parser.

I'm not too keen on the solution because it relies on the unbound
fn that is being exposed for other reasons, but I can't think
of a better way to deal with this right now
2012-01-23 22:33:28 -08:00
Igor Minar ed78f0d830 chore(log): generic test log service with custom toEquals matcher
- any test that needs a logger can just inject provideLog
- logger has susict api that makes tests more readable
- custom toEquals matcher allows for pretty expectations
2012-01-23 22:33:28 -08:00
Vojta Jina dbffbefb7c refactor($controller): Add $controller service for instantiating controllers
So that we can allow user to override this service and use BC hack:
https://gist.github.com/1649788
2012-01-23 13:11:12 -08:00
Vojta Jina 0196411dbe refactor(scope.$watch): rearrange arguments passed into watcher (newValue, oldValue, scope)
As scopes are injected into controllers now, you have the reference anyway, so having scope as first argument makes no sense…

Breaks $watcher gets arguments in different order (newValue, oldValue, scope)
2012-01-23 11:11:27 -08:00
Vojta Jina 992c790f07 refactor(scope): separate controller from scope
Controller is standalone object, created using "new" operator, not messed up with scope anymore.
Instead, related scope is injected as $scope.

See design proposal: https://docs.google.com/document/pub?id=1SsgVj17ec6tnZEX3ugsvg0rVVR11wTso5Md-RdEmC0k

Closes #321
Closes #425

Breaks controller methods are not exported to scope automatically
Breaks Scope#$new() does not take controller as argument anymore
2012-01-23 11:05:36 -08:00
alkis f5343c9fd3 docs($http): fix missing quote 2012-01-22 00:30:39 -08:00
Igor Minar 0470ff04b4 docs(changelog): clarified breaking changes for 0.10.6 2012-01-19 15:47:55 -08:00
Igor Minar efe33a5e21 docs($http): doc fixes suggested by Gina 2012-01-19 12:39:05 -08:00
Igor Minar 7046d6053d chore(jstd): upgrade JSTD to 1.3.3d 2012-01-19 10:38:26 -08:00
Vojta Jina afc241bd28 docs(inputType): fix small typo 2012-01-19 00:27:32 -08:00
ludicast a507fb7bb3 docs(guide): update angular version in an example 2012-01-18 17:16:27 -08:00
Igor Minar 0ce139c42d chore(release): preparing the 0.10.7 moiré-vision iteration 2012-01-18 17:12:21 -08:00
Igor Minar b00262fffe chore(release): cutting the 0.10.6 bubblewrap-cape release 2012-01-17 13:54:18 -08:00
Igor Minar 3f98d6ac99 docs(*): more docs 2012-01-17 12:19:26 -08:00
Igor Minar 22309c312f fix(docs): disable appcache - causing too much trouble 2012-01-17 12:13:29 -08:00
Igor Minar fcf95a47d1 docs(*): more fixes 2012-01-17 11:23:56 -08:00
Konstantin Stepanov e1e7aca9a6 fix($locationProvider) hashPrefix's getter returned html5Mode + doc fix 2012-01-17 11:21:20 -08:00
Vojta Jina 039041e3ae docs: syntax highlight auto bootstrap code example 2012-01-17 11:00:25 -08:00
Igor Minar 3da441b580 docs(release-notes): 0.10.6 bubblewrap-cape release 2012-01-17 09:49:40 -08:00
Igor Minar f9502d2ad3 fix(docs): temp hack to get appcache properly invalidated 2012-01-17 09:49:39 -08:00
Igor Minar 0356c90af8 chore(jquery): make the license header closure friendly 2012-01-17 09:49:39 -08:00
Igor Minar 0d4def452e fix(Rakefile): rewrite version number for mocks.js 2012-01-17 09:49:39 -08:00
Vojta Jina 897d0f1424 docs(guide): update the diagram 2012-01-17 09:49:38 -08:00
Igor Minar 92af30ce6e docs(*): various doc fixes 2012-01-17 09:49:37 -08:00
Igor Minar 54581d36df fix(e2e $httpBackend): use browser.defer instead of $defer
this is necessary to avoid $apply from within $apply situations
2012-01-16 23:26:44 -08:00
Igor Minar b587091b6e feat(jqLite): added injector() helper method 2012-01-16 02:17:27 -08:00
Vojta Jina c49b8a2db5 fix($location): do not $digest if browser's url change fired within $apply/$digest
Chrome (probably other browsers as well) fires 'hashchange' event synchronously, so if you change raw location from within $apply/$digest, we don't want to $apply twice. (It would throw an exception)
2012-01-14 11:23:12 -08:00
Misko Hevery 5cdfe45aa3 feat(module): add runtime block 2012-01-13 14:28:43 -08:00
Igor Minar 16a40c626f style(*): small fixes 2012-01-13 14:28:21 -08:00
Igor Minar b7f4d8c3c3 fix($http): anonnymous response interceptors should be treated as factories 2012-01-13 14:28:20 -08:00
Igor Minar 939c8e8fac docs($http, $httpBackend): docs docs docs 2012-01-13 14:28:20 -08:00
Igor Minar d2ba4c5170 fix(ngdocs): add '=' to type signatures with optional arguments 2012-01-13 13:53:07 -08:00
Igor Minar 46691c2721 fix($http): remove support for PATCH + better whenXXX, expectXXX api
- there are too many unknowns about PATCH, so I'm dropping its support until we know that this is actually useful
- expectGET, expectHEAD and expectJSON (and the same for whenXXX) should not require response data to be specified
2012-01-13 13:53:07 -08:00
Vojta Jina e7a23e4b65 fix(docs): generate correct ids on h elements to get scrolling working 2012-01-13 01:07:17 -08:00
Vojta Jina 15fd735793 refactor($autoScroll): rename to $anchorScroll and allow disabling auto scrolling (links)
Now, that we have autoscroll attribute on ng:include, there is no reason to disable the service completely, so $anchorScrollProvider.disableAutoScrolling() means it won't be scrolling when $location.hash() changes.

And then, it's not $autoScroll at all, it actually scrolls to anchor when it's called, so I renamed
it to $anchorScroll.
2012-01-13 01:07:12 -08:00
Vojta Jina 985d3d7558 refactor($autoScroll): rename method in test + use $apply instead of $digest 2012-01-13 01:05:24 -08:00
Vojta Jina 249c89c091 fix($autoScroll): scroll even if $location is in html5 mode
+ use autoscroll in docs (ng:include)
2012-01-13 01:01:26 -08:00
Vojta Jina 5164ae545b style(mocks): remove console.log 2012-01-13 00:37:16 -08:00
Misko Hevery e1e0ddb910 docs(inject/module): add documentation 2012-01-12 17:10:48 -08:00
Misko Hevery d648d709f3 refactor(module): strict separation between module-config / app-runtime 2012-01-12 13:40:07 -08:00
Vojta Jina 9a8dbfef51 style(mock): make jslint and igor happier 2012-01-11 22:11:06 -08:00
Vojta Jina 28114de8dc refactor(mock.$httpBackend): split (e2e/unit testing version of $httpBackend mock) 2012-01-11 22:11:01 -08:00
Vojta Jina c6ea1be053 fix(mock.$httpBackend): resetExpectations should not create new array 2012-01-11 11:48:03 -08:00
Misko Hevery 5143e7bf06 feat(module): new module loader 2012-01-10 22:27:00 -08:00
Misko Hevery afd25446d2 feat(ngdocs): support for interface documentation 2012-01-10 22:21:54 -08:00
Misko Hevery 3c3e6980b3 chore(specs.js): remove unused dependency 2012-01-10 22:21:54 -08:00
Misko Hevery e0b4b107ee chore(license): update year 2012-01-10 22:21:54 -08:00
Igor Minar 614fd3d55a fix(ng:repeat): support repeating over array with null
typeof null == 'object', but it doesn't behave like an object
because its properties can't be dereferenced, so we need
to special-case it.

Closes #702
2012-01-10 22:21:53 -08:00
Igor Minar 7146f70636 fix($httpBackend): fix for jsonp requests 2012-01-09 14:38:32 -08:00
Igor Minar 11cb9423a7 chore(docs): disable disqus for localhost
it's just slowing down the test runs and debugging
2012-01-09 13:17:49 -08:00
Igor Minar c76a120bfe fix(nodeserver): add dummy favicon.ico to silence 404s 2012-01-09 13:17:49 -08:00
Igor Minar b8960c3710 chore($http): small $http fixes 2012-01-09 13:17:48 -08:00
Igor Minar 67338ce061 feat($http): turn mock backend into a decorator + e2e testing support
- provider -> decorator
- autoflush + passThrough mode
- fix noop -> angular.noop
2012-01-09 13:17:48 -08:00
Igor Minar 23f8da7cbb feat($http): expose req/resp headers to transform fns 2012-01-09 13:17:48 -08:00
Igor Minar b911e303ec feat($httpBackend): add expect/when shortcut methods 2012-01-09 13:17:48 -08:00
Igor Minar a13b5ed3bc fix($http): fix and cleanup $http and friends
$http:
- use promises internally
- get rid of XhrFuture that was previously used internally
- get rid of $browser.defer calls for async stuff (serving from cache),
  promises will take care of asynchronicity
- fix transformation bugs (when caching requested + multiple request
  pending + error is returned)
- get rid of native header parsing and instead just lazily parse the
  header string

$httpBackend:
- don't return raw/mock XMLHttpRequest object (we don't use it for
  anything anymore)
- call the callback with response headers string

mock $httpBackend:
- unify response api for expect and when
- call the callback with response headers string
- changed the expect/when failure error message so that EXPECTED and GOT
  values are aligned

Conflicts:

	src/service/http.js
	test/service/compilerSpec.js
	test/service/httpSpec.js
2012-01-09 13:17:48 -08:00
Igor Minar 63cca9afbc feat(browser.defer): flush should throw exception when queue is empty 2012-01-09 13:17:48 -08:00
Vojta Jina d47ec772c3 docs(fix): select widget name -> ng:model 2012-01-08 15:06:12 -08:00
Vojta Jina 5c19766063 feat(ng:include): enable/disable scrolling through autoscroll attribute 2012-01-07 00:18:22 -08:00
Vojta Jina f2119c7524 fix($httpBackend): respond 200/404 when on file protocol (fix protocol parsing) 2012-01-06 19:20:29 -08:00
Dhruv Manek 08029c7b72 fix(angular.copy): throw Error if source and destination are identical
Closes #693
2012-01-06 12:19:39 -08:00
Igor Minar 0bf611087b feat(scope): throw exception when recursive $apply 2012-01-06 12:19:39 -08:00
Igor Minar acb4338b70 style(widgetsSpec): ws, unused variables, etc 2012-01-06 12:19:39 -08:00
Igor Minar cd9a7b9608 fix(ng:repeat): support repeating over array with null
typeof null == 'object', but it doesn't behave like an object
because its properties can't be dereferenced, so we need
to special-case it.

Closes #702
2012-01-06 12:19:39 -08:00
Vojta Jina 1dccaaaaa2 chore(readme): add some links and update test commands 2012-01-05 19:54:42 -08:00
Igor Minar 9632f5c1c7 style(q): rename src/Deferred.js to src/service/q.js 2012-01-03 17:48:09 -08:00
Igor Minar bb3be87606 style(q): reorganize the file + drop fallback dependencies 2012-01-03 17:48:09 -08:00
Igor Minar 174952e443 docs(q): documentation for all $q apis 2012-01-03 17:31:23 -08:00
Vojta Jina 6f91ffeb91 style: prefer single quotes + some whitespaces 2012-01-03 15:09:00 -08:00
Vojta Jina c594f75b4c refactor: remove old JSTD assertions
So that we can run the tests even without JSTD :-D
2012-01-03 15:09:00 -08:00
Mark Hansen 50eb7f15b8 docs(scope): fix typo $digest -> $watch 2012-01-03 15:01:34 -08:00
Sean Gilligan 212a6ff29a docs(resource): fix params for non-get actions 2012-01-03 14:57:38 -08:00
Igor Minar 871252ab4c docs(guide): fix $xhr -> $http links 2011-12-07 16:59:06 -08:00
bartes 0c534644bc fix(input): bind inputs to the 'input' event
The input event is fired on all non-ie browsers whenever the contents of an input
field changes. This means that we now support cut&paste via mouse which
was previously unsupported.

IE8 and older don't support this events and IE9 has a problematic
support for it, so we can't rely solely on this event and drop keydown
and change events.
2011-12-07 13:07:20 -08:00
Igor Minar c28662d28d fix(filter): remove the $ prefix from filter service ids 2011-12-07 13:07:19 -08:00
Igor Minar b97c6e5f74 style(scopeSpec): clean up scopeSpec.js 2011-12-07 09:41:09 -08:00
Igor Minar 4e3c05b99e feat(injector): add $provide.decorator 2011-12-07 09:41:08 -08:00
Igor Minar 5e4d59adf0 style(injector): cleanup of InjectorSpec.js 2011-12-07 09:41:07 -08:00
Igor Minar fd38655e6c fix(): use angular.callbacks namespace for jsonp callbacks
Previously we used to put callbacks on the window object, but that
causes problems on IE8 where it is not possible to delete properties
from the window object
2011-12-07 07:54:09 -08:00
Vojta Jina b9001e9147 fix(route): $destroy scope after update and reload
When we update route (changing only search param, no route reload) and then reload (change to different
route), it did not $destroy last scope.
2011-12-06 13:35:05 -08:00
Igor Minar d1e7a5394a docs(form): add docs about form submission 2011-12-06 13:32:49 -08:00
Vojta Jina 2090136dd8 docs(ng:submit): update docs example to not add empty items 2011-12-06 13:07:27 -08:00
Vojta Jina c9f2b1eec5 feat(form): do not prevent submission if action attribute present 2011-12-06 13:07:26 -08:00
Igor Minar 163e05ed36 feat($http): allow interceptors to be services 2011-12-05 23:53:26 -08:00
Igor Minar 2986a09c0d fix(jqLite): JQLiteHasClass should work even when minified
closure compiler is smarter than we expected and drops the unused fn
argument - this breaks the meta-programing logic of jqLite.

The fix special cases JQLiteHasClass since its the only fn that needs
this treatment in a way that is minification-proof.
2011-12-05 14:12:00 -08:00
Igor Minar bb2e7488fa fix($httpBackend mock): getResponseHeader should be case insensitive 2011-12-01 18:21:45 -05:00
Igor Minar 44b2f44f93 fix($resource): forwardport exposing headers from 0.9.19 2011-12-01 16:20:08 -05:00
Igor Minar 1d14760c6d fix(ng:include): prevent race conditions by ignoring stale http callbacks
This fix is similar to what I've done in ng:view, if a new template has been requested before the
callback for the previous template returned, ignore it. Otherwise weird race conditions happen
and users might end up getting the content for the previous include rendered instead of the most
recent one.
2011-11-30 14:49:36 -05:00
Igor Minar baa7af0df0 docs($location): add docs for the $location.search setter 2011-11-30 14:49:36 -05:00
Igor Minar f43c226c67 fix(copy,equals): prevent browser crashes with Scope or Window
Scope and Window instances are special and when copied can crash browser. For this reason
it makes sense to compare them only by identity.
2011-11-30 14:49:36 -05:00
Misko Hevery 0e1fa2aefe feat($interpolate): string interpolation function 2011-11-30 14:49:36 -05:00
Igor Minar 3d0ce0ebe9 feat($location): name the watch function to ease debugging 2011-11-30 14:49:36 -05:00
Igor Minar b00da987a9 scope($digest): add new&old val to the infinite $digest log 2011-11-30 14:49:35 -05:00
Igor Minar 188bdf7768 feat($http): add response interceptors 2011-11-30 14:49:35 -05:00
Igor Minar dbd880cc0a feat($http): add promise support
quite messy, some tests are missing, contains an experimental jasmine DI support)
2011-11-30 14:49:35 -05:00
Igor Minar bf8e0540f8 feat(dump): add support for arrays, functions, errors 2011-11-30 14:49:35 -05:00
Igor Minar 78b6e8a446 feat($parse): add support for transparent evaluation of Promises
Parser now builds expressions that can detect promises and transparently
evaluate them to undefined or the promise value.

If promiseA is resolved with value 'A', then {{promiseA}} evals to 'A';
If promiseA is unresolved, then {{promiseA}} evals to undefined;

Following invocations are supported:

- {{promise}}
- {{promise.futureProp}}
- {{[promise][0]}}
- {{object.promise}}
- {{object[promise]}}
- {{array[promise]}}
- {{fn(promise)}}
- combinations of the above
2011-11-30 14:49:35 -05:00
Igor Minar b656552d68 fix(angular-boostrap): add missing jQuery/jqLite binding 2011-11-30 14:49:35 -05:00
Igor Minar 1cdfa3b960 feat(deferreds/promises): Q-like deferred/promise implementation with a ton of specs 2011-11-30 14:49:03 -05:00
Vojta Jina 16363d8000 refactor(ng:view, ng:include): pass cache instance into $http
Instead of doing all the stuff in these widgets (checking cache, etc..) we can rely on $http now...
2011-11-30 14:49:03 -05:00
Vojta Jina 92995bbce9 fix($http): default json transformation should not crash on angular template
The way we determine whether it's json is lame anyway. We need to change that.
We should probably check the content type header...
2011-11-30 11:17:25 -05:00
Vojta Jina b9707d910e style(): get rid off some jsl warnings 2011-11-30 11:17:25 -05:00
Vojta Jina 5bbd64ac65 feat($http): allow passing custom cache instance per request
You can still use cache: true, which will use $http's default cache.
2011-11-30 11:17:25 -05:00
Vojta Jina caeb1bf899 feat($httpBackend): fix 0 status code when "file" protocol
Browsers return always 0 status code for "file" protocol, so we convert them into 200/404.
2011-11-30 11:17:24 -05:00
Vojta Jina 9b4efa73f9 feat(mock.$httpBackend): say which request was expected when unexpected request error 2011-11-30 11:17:24 -05:00
Vojta Jina 4aaa2f7f6b feat(mock.$httpBackend): verify expectations after flush() 2011-11-30 11:17:24 -05:00
Vojta Jina 6290bd4587 refactor(mock.$httpBackend): rename when().then() to when().respond() 2011-11-30 11:17:24 -05:00
Vojta Jina e9f81b6631 fix(mock.$httpBackend): flush() even requests sent during callbacks 2011-11-30 11:17:23 -05:00
Vojta Jina afbe073121 feat(mock.$httpBackend): add verifyNoOutstandingRequest method
+ rename verifyExpectations to verifyNoOutstandingExpectation
2011-11-30 11:17:23 -05:00
Vojta Jina 7b705df2b7 feat($http): broadcast $http.request event 2011-11-30 11:17:23 -05:00
Vojta Jina a4c8ac7126 feat(mock.$httpBackend): throw when nothing to flush, dump data/headers when expected different 2011-11-30 11:17:23 -05:00
Vojta Jina e3e2e4436e fix($http): add .send() alias for .retry() to get better stack trace on error 2011-11-30 11:17:22 -05:00
Vojta Jina 972c3e9be0 refactor($http): change callback matching mechanism 2011-11-30 11:17:22 -05:00
Vojta Jina feacf608ee fix($resource): to work with $http, $httpBackend services
Breaks Disabling $resource caching for the moment.
2011-11-30 11:17:22 -05:00
Vojta Jina fe633dd0cf fix($http): allow multiple json vulnerability prefixes
We strip out both:
)]}',
)]}'
2011-11-30 11:17:22 -05:00
Vojta Jina fdcc2dbfd3 feat($http): expose pendingRequests and configuration object
- $http.pendingRequests is now an array of pending requests
- each request (its future object) has public property configuration
2011-11-30 11:17:22 -05:00
Vojta Jina 5ad0c7d0e4 feat($httpBackend): extract $browser.xhr into separate service
- remove whole $browser.xhr stuff
- remove whole mock $browser.xhr stuff
- add $httpBackend service + migrate unit tests from $browser
- add temporary API to access $browser's outstandingRequests count
2011-11-30 11:17:22 -05:00
Vojta Jina 540701a8d8 feat(mocks.$browser): add simple addJs() method into $browser mock 2011-11-30 11:17:22 -05:00
Vojta Jina 4d2d70e7fb feat($templateCache): add $templateCache - shared by ng:include, ng:view 2011-11-30 11:17:21 -05:00
Vojta Jina cd28a2e952 feat(mocks.$httpBackend): add $httpBackend mock
$httpBackend mock allows:
- expecting (asserting) requests
- stubbing (responding without asserting)

Add empty $httpBackend service (currently just wrapper for $browser.xhr)
2011-11-30 11:12:14 -05:00
Vojta Jina 59adadca08 feat($http): new $http service, removing $xhr.*
Features:
- aborting requests
- more flexible callbacks (per status code)
- custom request headers (per request)
- access to response headers
- custom transform functions (both request, response)
- caching
- shortcut methods (get, head, post, put, delete, patch, jsonp)
- exposing pendingCount()
- setting timeout
Breaks Renaming $xhr to $http
Breaks Takes one parameter now - configuration object
Breaks $xhr.cache removed - use configuration cache: true instead
Breaks $xhr.error, $xhr.bulk removed
Breaks Callback functions get parameters: response, status, headers
Closes #38
Closes #80
Closes #180
Closes #299
Closes #342
Closes #395
Closes #413
Closes #414
Closes #507
2011-11-30 11:12:14 -05:00
Igor Minar 497839f583 feat($cacheFactory): add general purpose $cacheFactory service 2011-11-30 11:03:42 -05:00
Vojta Jina 5487bdb3d1 feat($browser.xhr): add timeout option to abort request
Timeouted request responds internal status code -1, which should be normalized
into 0 by $xhr.
2011-11-30 11:03:42 -05:00
Vojta Jina 3ae3ccf3da fix($browser.xhr): fix IE6, IE7 bug - sync xhr when serving from cache
IE6, IE7 is sync when serving content from cache.
We want consistent api, so we have to use setTimeout to make it async.
2011-11-30 11:03:42 -05:00
Vojta Jina e9b57f9df8 fix($browser.xhr): respond with internal -2 status on jsonp error
If jsonp is not successfull, we return internal status -2.
This internal status should by normalized by $xhr into 0,
but $xhr needs to distinguish between jsonp-error/abort/timeout (all status 0).
2011-11-30 11:03:42 -05:00
Vojta Jina 45f47ff6cd fix($browser.xhr): change method "JSON" to "JSONP"
Breaks "JSON" xhr method is now called "JSONP"
2011-11-30 11:03:41 -05:00
Vojta Jina 0c8b35681e feat($browser): xhr returns raw request object 2011-11-30 11:03:41 -05:00
Igor Minar a035e88397 docs(guide): fix directives guide docs 2011-11-28 18:04:01 -05:00
Vojta Jina 3548fe3139 feat(service.$autoScroll): scroll to hash fragment
- whenever hash part of the url changes
- after ng:view / ng:include load
2011-11-21 17:49:49 -08:00
Codier 29f9e2665d fix(scope): $watch (and angular.equals) should support NaN values
- since NaN !== NaN in javascript digest can get into an infinite loop
  when model value is set to NaN
- angular.equals(NaN, NaN) should return true since that's what we
  expect when comparing primitives or objects containing NaN values

Previously NaN because of its special === properties was used as the
initial value for watches, but that results in issues when NaN is used
as model value.

In order to allow for model to be anything incuding undefined and NaN we
need to mark the initial value differently in a way that would avoid
these issues, allow us to run digest without major perf penalties and
allow for clients to determine if the listener is being called because
the watcher is being initialized or because the model changed. This
implementation covers all of these scenarios.

BREAKING CHANGE: previously to detect if the listener was called because
the watcher was being initialized, it was suggested that clients check
if old value is NaN. With this change, the check should be if the newVal
equals the oldVal.

Closes #657
2011-11-21 15:43:12 -08:00
Igor Minar 8d1944851d fix(docs): specify disqus_url 2011-11-19 15:42:17 -08:00
TEHEK Firefox 3e1a6688c3 chore(browser): rename Browser.js -> browser.js, BrowserSpec.js -> browserSpec.js
And move them to proper service subfolder...
2011-11-18 12:05:55 -08:00
Misko Hevery aba9bb2a24 fix(input): treat all not number model as blank 2011-11-15 11:47:23 -08:00
Misko Hevery 5857c44e0c fix(radio): fix binding to value={{exp}} 2011-11-15 11:44:36 -08:00
Misko Hevery 8adae2fdf2 refactor(injector): removed loadModule/ng:module
- added module property to doc:example
2011-11-14 20:31:21 -08:00
Misko Hevery 955551141d style(angularPublic): move public export definition to AnuglarPublic.js 2011-11-14 20:31:21 -08:00
Misko Hevery 94e1a07b28 doc(rename): NG_LOCALE -> ngLocale 2011-11-14 20:31:20 -08:00
Misko Hevery ac73e8877e add(doc): added missing angular.module.ng namespace 2011-11-14 20:31:19 -08:00
Misko Hevery e88dfb734a refactor(injector): $injector is no longer a function.
- $injector('abc') -> $injector.get('abc');
- $injector(fn) -> $injector.invoke(null, fn);
2011-11-14 20:31:19 -08:00
Misko Hevery 8d6dc0b9a7 del($eager): removed the support for $eager services 2011-11-14 20:31:19 -08:00
Vojta Jina acbd7cdf32 style(docs): make jslint happy - fix some warnings 2011-11-14 20:31:19 -08:00
Misko Hevery 035c751076 fix(doc) cleanup all dev guide doc link warnings 2011-11-14 20:31:18 -08:00
Misko Hevery 186a840cd3 feat(bootstrap): added angular.bootstrap method 2011-11-14 20:31:18 -08:00
Misko Hevery b09595a3c1 fix(doc) cleanup all api doc link warnings 2011-11-14 20:31:18 -08:00
Misko Hevery f6d98f1472 fix(doc): make output less noisy 2011-11-14 20:31:17 -08:00
Vojta Jina 5279de0e70 fix($location): links without path segment should not change the path
Closes #648
2011-11-14 20:31:17 -08:00
Misko Hevery 8fe77b69e8 refactor(docs): improved the visual rendering of the documentation pages 2011-11-14 20:31:17 -08:00
Misko Hevery 1cc6bee4ce docs(browser): moved and migrate browser removed unneeded files. 2011-11-14 20:31:17 -08:00
Misko Hevery a8aa193c6b doc($rootScope): scope documentation changes 2011-11-14 20:31:17 -08:00
Misko Hevery e45b013143 doc(locale): migrate docs to new format 2011-11-14 20:31:16 -08:00
Misko Hevery ea18f4548d doc($formFactory): migrated the $formFactory documentation 2011-11-14 20:31:16 -08:00
Misko Hevery 57c37a21d1 doc(service): update docs for the moved services 2011-11-14 20:31:16 -08:00
Misko Hevery 74fac45f48 doc($filter): added $filter documentation 2011-11-14 20:31:16 -08:00
Misko Hevery f0fa5e6376 doc(AUTO, NG_MOCK): Documenting the AUTO and NG_MOCK module 2011-11-14 20:31:16 -08:00
Misko Hevery c283bf6035 refactor($location): merged $locationConfig service into $locationProvider 2011-11-14 20:31:15 -08:00
Misko Hevery b3c17f3fdc chore(scope): remove $service 2011-11-14 20:31:15 -08:00
Misko Hevery 9c06394376 chore(scenario tests): make scenario tests pass again 2011-11-14 20:31:15 -08:00
Misko Hevery 085e3c611f new(directive): added ng:module directive for loading modules 2011-11-14 20:31:15 -08:00
Misko Hevery 4b35a59c6a refactor(scenario): fix scenario bootstrap & publish injector for inspection 2011-11-14 20:31:14 -08:00
Misko Hevery 7cb03c5ab9 chore(angular): clean up unused constants 2011-11-14 20:31:14 -08:00
Misko Hevery 78c7066422 refactor(angular): isDate / isArray test iframe independent fix 2011-11-14 20:31:14 -08:00
Misko Hevery 923da410bd fix(i18n): updated the way locale is being registered 2011-11-14 20:31:14 -08:00
Misko Hevery a87f2fb9e4 refactor(mock): moved mocks into its own module 2011-11-14 20:31:14 -08:00
Misko Hevery c27aba4354 refactor(api): remove type augmentation
BREAK:
  - remove angular.[Object/Array/String/Function]
  - in templates [].$filter(predicate) and friends need to change to [] | filter:predicate
2011-11-14 20:31:14 -08:00
Misko Hevery dd9151e522 refacter(filters): convert filter/limitTo/orderBy from type augmentation to filters 2011-11-14 20:31:13 -08:00
Misko Hevery 3972d2a89b refactor(json): break dependence on api.js 2011-11-14 20:31:13 -08:00
Misko Hevery cb6f832f38 refactor(filter): filters are now injectable and services
BREAK:
 - removed CSS support from filters
2011-11-14 20:31:09 -08:00
Misko Hevery 6022f3df39 move(filters): appease the History God 2011-11-14 16:39:34 -08:00
Misko Hevery 7c11531902 refactor(parser): turn parser into a service (keep compatibility hack) 2011-11-14 16:39:33 -08:00
Misko Hevery c6d2549a52 fix(JSON): json date parsing same native/ngular parser 2011-11-14 16:39:33 -08:00
Misko Hevery bee6060e4b move(parser): appease the History God 2011-11-14 16:39:33 -08:00
Misko Hevery 16597e8b52 refactor($service): removed almost all references to scope.$service
- still need to remove from factory
2011-11-14 16:39:33 -08:00
Misko Hevery f684f20c99 cleanup(parser): removed unused method 2011-11-14 16:39:33 -08:00
Misko Hevery bd04316a89 refactor(services): migrate angular.service -> module 2011-11-14 16:39:33 -08:00
Misko Hevery ed36b9da3b refactor(injector): switch to injector 2.0 introduce modules 2011-11-14 16:39:32 -08:00
Misko Hevery c925f8a657 new(injector): new injector v2.0
- not connected to keep the CL small
2011-11-14 16:39:32 -08:00
Misko Hevery 4c10d33eb4 refactor(api): cleaned up the externalization of angular API methods 2011-11-14 16:39:32 -08:00
Misko Hevery 9062996a0e feat(injector): support $inject(fn($service){}) function invocation 2011-11-14 16:39:32 -08:00
Misko Hevery 411c1ae77e feat(injector): support ['$service', function($service){}] annotations for function invocation. 2011-11-14 16:39:32 -08:00
Misko Hevery d12df0d360 refactor(compiler) turn compiler into a service
BREAK
- remove angular.compile() since the compile method is now a service and needs to be injected
2011-11-14 16:39:32 -08:00
Misko Hevery d9b58f23f6 move(compiler): appease the History God
-	renamed:    src/Compiler.js -> src/service/compiler.js
-	renamed:    test/CompilerSpec.js -> test/service/compilerSpec.js
2011-11-14 16:39:32 -08:00
Misko Hevery 03dd8c4f4c feat(injector): Service look up failures include dependency path 2011-11-14 16:39:32 -08:00
Misko Hevery 48697a2b86 refactor(injector): turn scope into a service
- turn scope into a $rootScope service.
- injector is now a starting point for creating angular application.
- added inject() method which wraps jasmine its/beforeEach/afterEach,
  and which allows configuration and injection of services.
- refactor tests to use inject() where possible

BREAK:
- removed angular.scope() method
2011-11-14 16:39:31 -08:00
Misko Hevery 93b777c916 move(scope): appease the History God
-	renamed:    src/Scope.js -> src/service/scope.js
-	renamed:    test/ScopeSpec.js -> test/service/scopeSpec.js
2011-11-14 16:39:31 -08:00
Vojta Jina 5c70ff72e2 style(docs): make jslint happy - fix some warnings 2011-11-13 16:40:31 -08:00
Vojta Jina 5e663c3dc7 fix(docs.guide): fix $location example 2011-11-13 16:40:31 -08:00
Vojta Jina 260725efcd feat(docs): allow examples with hidden source code 2011-11-13 16:40:31 -08:00
Vojta Jina 4afad1da29 feat(docs): allow custom attributes on <doc:source>
Allow any attributes, not only jsfiddle...
2011-11-13 16:40:31 -08:00
Dhruv Manek eb01fe593d feat(jquery): upgrade to jQuery 1.7
no breaking changes AFAICT
2011-11-13 16:30:21 -08:00
Misko Hevery fc7834f9ac cleanup(parser): remove unused method 2011-11-11 13:04:26 -08:00
Misko Hevery e4303a1f3a chore(test): remove stale bit-rotten code
- deleted:    test/manual.html
2011-11-09 08:54:04 -08:00
Igor Minar 1e00db8daa fix(directives): make directive names case-insensitive
+ tests
+ added docs for angular.directive
2011-11-08 21:44:46 -08:00
Igor Minar aaa0179758 chore(release): preparing the 0.10.6 bubblewrap-cape iteration 2011-11-08 16:39:19 -08:00
Igor Minar f5ef3724ce chore(release): cutting the 0.10.5 steel-fist release 2011-11-08 04:29:07 -08:00
Igor Minar e60601be4f docs(changelog): release notes for 0.10.5 steel-fist 2011-11-08 04:29:07 -08:00
Dhruv Manek e2663f62b0 feat(ng:style): compatibility + perf improvements
- better compatibility with 3rd party code - we clober 3rd party
  style only if it direcrtly collides with 3rd party styles
- better perf since it doesn't execute stuff on every digest
- lots of tests
2011-11-08 02:25:22 -08:00
Igor Minar 9f9ed4c5ff docs(ng:bind-attr): improve examples 2011-11-08 02:23:51 -08:00
Igor Minar 66fc268aeb docs(css): fixing positioning of disqus comments
float:left causes the comments to shift to the left when content is longer
than the sidebar
2011-11-05 22:30:50 -07:00
Vojta Jina 1d966f8a65 style(angularFiles): just missing semi-colon and extra comma 2011-11-01 14:14:52 -07:00
Vojta Jina ddf6f1143f test(mocks): test mocks with compiled angular
Unfortunately, there people in our team (me), who are not able to use angular.* namespace prefix
when writing angular-mocks code, so we need to test it...
2011-10-31 18:22:38 -07:00
Vojta Jina 2636105c5e feat(matchers): extract jasmine matchers into separate file for future reuse
Prefix all used functions with angular.* so that they can be used with compiled angular as well...
2011-10-31 18:22:21 -07:00
Igor Minar c0b557a96c test(scope): infinite digest test should pass on all browsers
Different browsers print function body differently, and best of all IE doesn't have
function.name property.
2011-10-31 12:46:12 -07:00
Igor Minar 84873e7f4e fix(angular-bootstrap): fix boostrap scripts that broke w\ 5a2dcb9a
Commit 5a2dcb9a doesn't properly modify angular-boostrap.js.

This fix resolves issues and makes both the regular and scenario
version of angular-boostrap.js functional.
2011-10-31 11:34:25 -07:00
Igor Minar 95fdb1231f chore(watchr): watchr scripts should output logs to terminal
Having the extra level of indirection by using logs/*.log file
only makes it more difficult to use these scripts. After this
change it will be enough to just start the watchr and watch the
terminal it was started in.
2011-10-31 11:34:25 -07:00
Igor Minar ef875ad0cf feat(scope): better logging of infinite digest error
Feedback team has often problems debugging inifinite digest errors, this change
should reveal info about what watchers are causing the infinite loop
2011-10-31 11:34:25 -07:00
Igor Minar 615841a5d3 style(widgets): fix typo in a spec comment 2011-10-31 07:19:33 -07:00
Vojta Jina 7d0c256ecd docs(jqlite): add missing methods 2011-10-30 22:31:03 -07:00
Igor Minar 6cbe096dbf feat(docs): remove the Report Issue link - duplication of disqus 2011-10-30 22:27:25 -07:00
Igor Minar 21602b5cd6 fix(docs): special case url generation for index pages 2011-10-30 22:27:25 -07:00
Igor Minar 4ae671ac88 fix(docs): increment load counter only when a valid page is requested 2011-10-30 22:27:25 -07:00
dandoyon 28ed5ba465 feat(docs): disqus integration
- add style for disqus threads in css
- add loadDisqus method to be called afterPartialLoaded
- add div container for disqus threads
2011-10-30 22:27:25 -07:00
Igor Minar 02dc81bae0 fix(css): ng:form should always be a block element 2011-10-30 22:26:32 -07:00
Igor Minar 445680f601 fix(nodeserver): properly escape all, not just first char 2011-10-27 08:44:14 -07:00
Vojta Jina bf729d550b feat(docs): Add scenario runner into dev guide
And update the link in the tutorial as well...
2011-10-26 15:58:59 -07:00
Vojta Jina dc8ffa51b7 fix(scenario.dsl): Fix dsl for $location
New $location does not have hashSearch, hashPath.
The old dsl was mixing $location / window.location so this solves the problem as well...
2011-10-26 15:58:59 -07:00
Igor Minar d7ba5bc83b feat(bootstrap): drop angular.js file name restrictions for autobind
The last script element in the dom is always us if the script that
contains angular is loaded synchronously.

For async loading manual bootstrap needs to be performed.

Close #621
2011-10-26 12:57:15 -07:00
Igor Minar 950d02b4d4 fix(docs): remove unused $browser dependency 2011-10-26 12:57:14 -07:00
Igor Minar 578e38e0af fix(example): fixes for personalLog e2e tests
Looks like this got broken with scope rewrite.
2011-10-26 12:57:14 -07:00
Igor Minar af7c51ee1d style(Angular.js): various code style fixes 2011-10-26 12:57:14 -07:00
Igor Minar 25d1822bd8 style(HashQueueMap): fixing a typo in the comment 2011-10-26 12:54:00 -07:00
Igor Minar 3945f884c5 fix(ng:repeat) with array ignore properties not representing array elements
Along the way I also changed the repeater impl to use for loop instead
of for in loop.

Iteration over objects is handled by creating an array of keys, which is
sorted and this array then determines the order of iteration over an
element. This makes repeating over objects deterministic and
cross-browser compatible.
2011-10-26 12:54:00 -07:00
Igor Minar d5ccabce60 fix(ng:view): ignore stale xhr callbacks
A lot of badness happens when we don't ignore stale xhrs. These
raceconditions are only apparent when user clicks through the app very
quckly without waiting for routes to fully load.

Closes #619
2011-10-26 12:15:07 -07:00
Igor Minar bb948176aa test(ng:view): spec cleanup
- remove optional controller definition from specs
- remove extranious digest calls
2011-10-26 12:02:30 -07:00
Dhruv Manek 163c799eff fix(angular.widget): Allow widgets to be styled in IE8 and below
Closes #584
2011-10-24 23:28:36 -07:00
Vojta Jina 7da70af1ae fix(scenario): Change title to "AngularJS" 2011-10-24 14:03:50 -07:00
Igor Minar 836e4c1428 chore(release): preparing the 0.10.5 steel-fist iteration 2011-10-24 09:16:33 -07:00
Igor Minar eabedba34d chore(release): cutting the 0.10.4 human-torch release 2011-10-22 21:39:39 -07:00
Igor Minar b4add97c17 docs(changelog): update changelog with 0.10.4 release notes 2011-10-22 21:39:39 -07:00
Igor Minar bacc31bea9 fix(defer.cancel): should return false instead of undefined 2011-10-22 21:32:48 -07:00
Igor Minar ad90c3574f feat($defer): add $defer.cancel
This functionality was previously available only as obscure $browser.defer.cancel.

I also added docs and tests and fixed an issue in .defer.cancel mock.
2011-10-22 21:32:48 -07:00
Igor Minar e28171d5e4 fix(docs): key-binding used old scope apis 2011-10-22 21:32:48 -07:00
Igor Minar ce73ed091b feat(docs): add "Loading..." notification 2011-10-22 21:32:47 -07:00
Igor Minar 90ac8d57b0 fix(docs): update page title only when content loads 2011-10-22 21:32:47 -07:00
Igor Minar 6eb1179505 style(docs): change "this" to "scope" in the controller 2011-10-22 21:32:47 -07:00
Vojta Jina 9b85757102 fix($location): rewrite links with nested elements
For example:
<a href="some/link">inner <span>text</span></a>

If you click on "text", then the span element is event.target, so we need to traverse the DOM.
2011-10-22 15:35:18 -07:00
Igor Minar c6c3949b14 feat(filter.date): use mediumDate as default
Breaking change!

Previously the default was fullDate.
2011-10-20 16:51:28 -07:00
Igor Minar e175db37c6 fix(date filter): default to fullDate format
The browser's behave inconsistently, so we should just stick to one format
when the format is not specified by the developer

Closes #605
2011-10-20 16:51:28 -07:00
Igor Minar f38010d3a2 fix(compiler): revert 8611ebe6 - calling \$digest after linking
Change introduced by me in 8611ebe6 results in considerable inefficiencies when the compiler
and linker is used from within a widget, in which case, we call $digest unnecessary since it
will be called by the $apply which called the directive/widget in the first place.

There are only two places when the extra $digest call can be useful - when manually bootstrapping
the app or in tests. However even in tests this behavior can result in unwanted results (especially
when ng:controller is involved). So it is better to leave it for the developer to call $digest
when it is really needed.
2011-10-20 15:51:14 -07:00
Misko Hevery 7fc18b263d fix(radio): allows data-binding on value property. Closes#316 2011-10-20 11:30:40 -07:00
Igor Minar fabc9f77a3 feat(sanitizer): add html5 elements to the whitelist
Closes #89
2011-10-20 09:44:52 -07:00
Igor Minar c17c731fdc style(select): cleaning up select.js 2011-10-19 22:52:14 -07:00
TEHEK Firefox 3692885810 fix(ng:options): compile null/blank option tag
Fixes #562
2011-10-19 22:52:14 -07:00
Igor Minar 5d43439dbe fix(ng:pattern): correctly parse out inlined regexp 2011-10-19 21:52:20 -07:00
Igor Minar a46f2a0db3 docs(textarea): add docs for angular.widget.textarea 2011-10-19 16:49:34 -07:00
Igor Minar 3217a249e1 style(input): fix style violations in the input.js file 2011-10-19 16:49:34 -07:00
Konstantin Stepanov 78f394fd17 feat(input): add ng:minlength and ng:maxlength validation
notes(igor): I also e2e tests and refactorred the e2e test example to be
more clear about what is a variable and what is an html/framework api.
2011-10-19 16:49:20 -07:00
Konstantin Stepanov e82e64d57b fix(input): recognize 'password' as an html input type 2011-10-19 10:36:36 -07:00
Vojta Jina 8978e066b5 fix(gen-docs): require files without touching PATH
So that it works on latest revision of node...
New version of Node (v0.5.x) does not support require.paths.push().
2011-10-18 22:23:52 -07:00
Igor Minar 833eb3c844 fix(ng:repeat): repeater should ignore $ and $$ properties 2011-10-18 17:27:43 -07:00
Igor Minar 07926ff1ef chore(version.yaml): add missing snapshot version suffix 2011-10-18 17:25:10 -07:00
Igor Minar e801faba2e chore(jstd adapter): switch to our version with backported fixes
sha of the version: da92db714142b49f9cf61db664e782bb0ccad80b
2011-10-18 16:21:52 -07:00
TEHEK Firefox ee6af9a978 fix(ng:options): select correct element when '?'-option was previously selected
Closes #599
2011-10-18 14:02:54 -07:00
Igor Minar 74379df6c4 chore(release): preparing the 0.10.4 human-torch iteration 2011-10-14 15:29:17 -07:00
Igor Minar fe65dd926c chore(release): cutting the 0.10.3 shattering-heartbeat release 2011-10-14 08:31:39 -07:00
Igor Minar 669b53ede2 fix(docs): fix jsfiddle integration
this got accidentally messed up during the forms refactoring and mass renaming
2011-10-14 08:31:00 -07:00
Igor Minar b0c3f28e8f docs(forms): fix devguide forms example code 2011-10-14 08:30:02 -07:00
Igor Minar 9810dc0993 docs(cookbook): disable jsfiddle for deeplinking example
it uses extra resources, so it won't work on fiddle
2011-10-14 08:29:33 -07:00
Vojta Jina ab5df20dfa chore(libs): update libs (jasmine, jstd, jasmine-jstd adapter) 2011-10-13 17:36:11 -07:00
Igor Minar d83a92c121 fix(checkbox): prefix true-value & false-value with ng: 2011-10-13 17:35:00 -07:00
Igor Minar d0425de29e chore(release): preparing release notes for 0.10.3 2011-10-13 16:54:30 -07:00
Igor Minar ad5e42cf82 docs($location): Html5 -> HTML5 2011-10-13 14:42:49 -07:00
Igor Minar 9ed1126adb docs($location): update replace() docs 2011-10-13 14:37:37 -07:00
Igor Minar 7a19eb84aa docs($location): fix $config -> $locationConfig in docs 2011-10-13 14:07:48 -07:00
Igor Minar 718741acab chore(logo): add hi-res ng logo 2011-10-13 13:44:38 -07:00
Vojta Jina ec8bb675b4 fix(docs): set proper base href when hashbang url requested 2011-10-13 11:10:20 -07:00
Vojta Jina 8e32f3fd35 fix(nodeserver): docs rewriting
There can be url /api which does not end with / and we want to rewrite this url as well...
2011-10-13 11:10:20 -07:00
Vojta Jina 02332107e5 feat(nodeserver): if index.html exists, serve it instead of directory listing 2011-10-13 11:10:20 -07:00
Vojta Jina afc81b554e fix($location): do not rewrite link when meta key pressed 2011-10-13 11:10:19 -07:00
Vojta Jina 26e8ab3693 feat(scenario): allow key pressing when triggering browser event
Add parameter to our browserTriger function to allow specifying which keys are pressed.

Note, this does not work on IE<9 !
2011-10-13 11:10:19 -07:00
Igor Minar 28ccc76aa1 docs(dev_guide.bootstrap.auto_bootstrap): fixing a typo 2011-10-12 23:04:48 -07:00
Igor Minar b3c4cb7cff docs(*): remove @workInProgress from everywhere
it's not useful any more and it only makes the docs look ugly
2011-10-12 23:04:48 -07:00
Misko Hevery 4af4378b11 fix(forms): broken tests on jQuery and ie8&9 2011-10-12 23:04:48 -07:00
Igor Minar 8611ebe6a0 fix(compiler): linking function should call $digest
The linked scope should be $digest-ed but only if a $digest isn't
already running on it.
2011-10-12 23:04:48 -07:00
Igor Minar 8f46a3c9ac fix(jqLite): attr for boolean attribute should lowercase value 2011-10-12 23:04:47 -07:00
Igor Minar 66fdb36ecb refactor(ng:bind-attr): simplify impl by leveraging jquery 2011-10-12 23:04:47 -07:00
Igor Minar f0f5ffa9aa test(jstd-config): add widget specs to jsTestDriver-jquery.conf 2011-10-12 23:04:47 -07:00
Igor Minar 2bc7afd3ba fix(ng:class): ignore undefined or NaN classnames 2011-10-12 23:04:47 -07:00
Igor Minar a4b45397e0 docs(forms): add ng:change docs and other fixes 2011-10-12 11:49:42 -07:00
Igor Minar de4e06ed73 test(checkbox): add test for ng:change 2011-10-12 11:11:10 -07:00
Misko Hevery fd822bdaf9 chore(formating): clean code to be function() { 2011-10-11 11:01:46 -07:00
Misko Hevery 4f78fd692c feat(forms): new and improved forms 2011-10-11 11:01:45 -07:00
Misko Hevery df6d2ba326 style(examples): clean up dead examples 2011-10-11 10:53:07 -07:00
Misko Hevery ccda436f94 style(.gitignore) added IDEA 2011-10-11 10:53:07 -07:00
Misko Hevery e86c435349 refactor(bindings): remove the decoration of the DOM with errors.
Only $exceptionHandler gets notified now.
2011-10-11 10:53:07 -07:00
Misko Hevery 1942861472 refactor(hover): delete hover service 2011-10-11 10:53:06 -07:00
Misko Hevery b96e978178 fix(jqlite): removeClass would clobber class names 2011-10-11 10:53:06 -07:00
Misko Hevery bda2bba2be feat(jqlite): added .inheritedData method and $destroy event.
- refactored .scope() to use .inheritedData() instead.
- .bind('$destroy', callback) will call when the DOM element is removed
2011-10-11 10:53:05 -07:00
Misko Hevery ca08c004c8 feat(jqlite): support required as a no-value attribute 2011-10-11 10:53:05 -07:00
Misko Hevery 25a62b58db refactor(injection) infer injection args in ng:controller only
Because only controllers don't have currying, we can infer its arguments, all other APIs needing currying, automatic inference complicates the matters unecessary.
2011-10-11 10:53:04 -07:00
Misko Hevery 97e3ec4d1b style(gitignore): added xproject to ignore list 2011-10-11 10:53:04 -07:00
Misko Hevery 75f11f1fc4 feat(ng:repeat) collection items and DOM elements affinity / stability 2011-10-11 10:53:04 -07:00
Misko Hevery e134a8335f fix(filter): make json filter ignore private properties 2011-10-11 10:53:03 -07:00
Igor Minar 8ee32a75f0 chore(release): prepare the 0.10.3 shattering-heartbeat iteration 2011-10-10 11:23:08 -07:00
Igor Minar f6a8ad87ee chore(release): cutting the 0.10.2 sneaky-seagull release 2011-10-08 09:18:19 -07:00
Igor Minar 7e6ff401b8 docs(changelog): release notes for 0.10.2 sneaky-seagull 2011-10-08 09:15:10 -07:00
Dhruv Manek 7aeb6a24f7 fix(docs): rename doc dev_guide.templates.css to dev_guide.templates.css-styling
Closes #580
2011-10-07 18:20:20 -07:00
Dhruv Manek e1ecc34edd fix(parser): Fix short circuit of logical AND and OR operators
Closes #433
2011-10-07 16:01:09 -07:00
Misko Hevery 29d36e94e1 feat(gdocs): better error handling 2011-10-05 14:19:33 -07:00
dandoyon 091c173632 docs(started): fixing pluralization 2011-10-05 13:47:43 -07:00
TEHEK Firefox c115fa9924 fix($limitTo): properly handle excessive limits
`angular.Array.limitTo`'s  result should not exceed original input array size

Closes #571
2011-10-05 11:01:32 -07:00
Igor Minar b7a7fc7065 doc($log): fix the $log service example
is no longer auto-published on the root scope, so we need to publish
it via a controller
2011-09-29 03:21:24 +02:00
Igor Minar 21b2a5bd21 chore(directives): add a todo for ng:style 2011-09-28 23:57:01 +02:00
Igor Minar ca1e45beaf fix(jqLite): css should convert dash-separated properties to camelCase
this fix is needed for Firefox or other browsers that strictly follow
dom/css spec which states that element.style should make properties
available in camelCased form.

Closes #569
2011-09-28 23:57:00 +02:00
Igor Minar 084b83ffa9 test(matchers): add toBeOneOf matcher 2011-09-27 21:48:47 +02:00
Marcello Nuccio bf5e5f7bc9 fix($resource): action defaults should override resource defaults
defaults definned per action should take precedence over defaults
defined for the whole resource.

This is potentialy a BREAKING CHANGE in case someone relied on the buggy
behavior.
2011-09-27 00:44:10 +02:00
Igor Minar 2e9fed7b6c fix(e2e): add index-nocache.html to run e2e tests without cache
using appcache while running e2e tests was causing the following
problems:
- Safari would occasionally reload the app (as a result of the appcache
  refresh) during the angular.validator.asychronous test, which would
  result in test failure and false positivy.
- Firefox6 would run the tests very slowly, disabling the cache resolved
  the latency issues
- Sometimes tests would run with stale code pulled from cache, which
  would result in flaky tests.
2011-09-26 23:51:55 +02:00
Igor Minar ea3228e311 fix(scenario): workaround for FF6 dispatchEvent issue #684208 2011-09-26 23:51:54 +02:00
Igor Minar 2eb49147d6 Revert "fix(scenario): temporary fix for FF6"
This reverts commit aac68bf2ba.
2011-09-26 23:51:54 +02:00
Vojta Jina 13f92de624 feat(docs): use html5 history api for all routing in the docs app
- Configure our docs app to use new $location with html5 history api!

- Update simple node web server to serve index.html for all links
  (rewritting).

- Update .htaccess file to serve index.html for all links (rewritting).

- At runtime determine the base href path and attach it to the DOM. We
  needed the absolute URL to get all browsers to work well.

- Because of the above, we also need to dynamically determine all needed
  js/css resources and add them to the DOM. This was needed because FF6
  would eagerly fetch resources with wrong URL since the base element is
  added to the dom at runtime.

- All content html files were moved to the partials directory, because
  with the new html5 urls it was impossible to tell if request for
  http://domain/api/angular.filter.html was an html5 url for the html
  filter doc page, or an xhr/appcache request for the content html file
  for the html filter.

f
2011-09-26 23:51:53 +02:00
Igor Minar 2bc39bb0b4 fix($route): fix regex escaping in route matcher 2011-09-21 13:47:17 +02:00
Igor Minar 62ae7fccbc fix(angular-mocks): fix .defer.cancel when i=0 2011-09-16 14:18:45 +02:00
Igor Minar 3ace81b92a fix(e2e tests): use prop() instead of attr() and quote attributes
Because of changes in jQuery, we need to use element().prop() instead of element().attr() to retrieve className and other element properties.

Additionally all attribute selectors (e.g. input[name=value]) must have value quoted if it contains dots (".").
2011-09-16 02:44:35 +02:00
Igor Minar 9acf45127e fix(scenarioRunner): navigateTo should use prop('contentWindow')
... instead of attr('contentWindow')
2011-09-16 02:44:35 +02:00
Igor Minar 6883e8c7a0 feat(scenarioRunner): adding support for element().prop()
since jQuery 1.6.4 attr() focuses only on work with element attributes and doesn't deal well with element properties, so adding prop() support is required for getting many e2e tests to pass after upgrading the runner to jQuery 1.6.4.
2011-09-16 02:44:34 +02:00
Igor Minar 7ae536d053 fix(specs): various fixes to get IE8+jquery unit tests green 2011-09-16 02:44:33 +02:00
Igor Minar 2170c06924 fix(specs): fix jQuery to jqLite binding on IE8
It appears that this whole time all IE8 unit tests ran only with jqLite. Due to a weird bug in IE[1], we never overwrote jqLite implementation with jQuery, so the tests ran with our jqLite instead.

This affected only IE8 (and likely older) and only in unit testing mode. angular.js - the built artifact binds to jQuery just find.

[1] https://plus.google.com/104744871076396904202/posts/Kqjuj6RSbbT
2011-09-16 02:44:33 +02:00
Igor Minar 0e5a24c584 fix(specs): jQuery now returns attr name instead of true/false for special attrs
for special attrs like 'checked' or 'multiple', jquery now returns the name or undedefined.

e.g. foo.attr('checked') => 'checked' || undefined

The solution is a combination of updating our tests as well as switching
over to prop() instead which properly returns true/false
2011-09-16 02:44:32 +02:00
Igor Minar 4e8f0d6e9f fix($location) $location specs must unbind document listener
link rewriting used in html5 mode on legacy browsers binds to document.onClick - we need to destroy this listener after each test to prevent test collisions (global state is evil).
2011-09-16 02:44:31 +02:00
Igor Minar f9b6b61468 fix(scenario dsl): jQuery getters must have no value
jQuery now requires getter methods to have no value at all -
they do arguments.length check to identify getters vs setters.
2011-09-16 02:44:31 +02:00
Igor Minar 555f415290 fix(ng:options): fix selecting options
Contains 3 fixes:

- the internal model was by mistake using "checked" property instead of
  "selected"
- use jqLite.prop() to set 'selected' property
- added inChangeEvent check - we should not interfere with the browser
  selecting elements when not necessary
2011-09-16 02:44:30 +02:00
Igor Minar 3800d17703 feat(jqLite): add prop() support
since jQuery 1.6.4 prop() became very important because attr() does't have access to certain properties any more (e.g. className), so I'm adding it to jqLite as well so that jqLite preserves the feature-set it had before the jQuery upgrade.
2011-09-16 02:44:30 +02:00
Igor Minar 009059dd1b fix(jqLite): make css() on IE8 behave the same way as jQuery 1.6.4 2011-09-16 02:44:29 +02:00
Igor Minar 6b7ddf414d feat(jqLite): add support for unbind()
supports these invocation types:

- foo.unbind();
- foo.unbind('eventType');
- foo.unbind('eventType', fn);

more info: http://api.jquery.com/unbind/
2011-09-16 02:44:29 +02:00
Igor Minar 8259f10138 fix(jqLite): make attr() compatible with jQuery 1.6.4
The behavior of attr() getter and setter changed in jQuery 1.6 and now they treat element properties and attributes as two different things, but in order to not break everyone there is a partial backwards compatibility for checking and updating element properties as well. see http://api.jquery.com/prop/ for more info.
2011-09-16 02:44:28 +02:00
Igor Minar ab407de54d fix(jqLiteSpec): jQuery's css() getter works only for valid rules
foo.css('bogus', 'value')
foo.css('bogus') => null

so I had to change all tests to use valid css rules
2011-09-16 02:44:28 +02:00
Igor Minar 0d7fe97aff fix(jqLite): attr() should not special-case 'class' attribute
since jQuery 1.6 'class' is not treated specially, so we have to revert this fix and use className in tests instead
2011-09-16 02:44:28 +02:00
Igor Minar a2a830e227 feat (jquery): upgrade everything to jQuery 1.6.4
Closes #556
2011-09-16 02:44:27 +02:00
Igor Minar 8336f3f0ba fix(angular-mocks): fix forEach -> angular.forEach in $browser.defer.cancel 2011-09-16 01:39:03 +02:00
Di Peng e14ac2c3b0 style(bootstrap): fix some missing spaces 2011-09-13 01:02:23 +02:00
Di Peng a13653c814 refactor(angular): externalize script load order into JSON
- move all script load order into angularFiles.js
- rakefile and angular-bootstrap.js use angularFiles.js to get script orders
- gen_jstd_configs.js uses angularFiles.js to generate various jstd config files
- run gen_jstd_configs.js whenever we run server.sh

Closes #470
2011-09-13 01:02:22 +02:00
Igor Minar 8017340cd1 chore(version): preparing the 0.10.2 sneaky-seagull iteration 2011-09-12 19:23:37 +02:00
Igor Minar 17d1aef66a chore(release): cutting the angular 0.10.1 inexorable-juggernaut release 2011-09-09 01:01:46 -07:00
Igor Minar 1856f62cb1 docs(changelog): release notes for angular 0.10.1 inexorable-juggernaut 2011-09-09 01:01:05 -07:00
Kai Groner 7e1f364177 fix($location): Use encodeUriQuery instead of escape
Closes #492
2011-09-08 23:00:59 +02:00
Vojta Jina aac68bf2ba fix(scenario): temporary fix for FF6
https://bugzilla.mozilla.org/show_bug.cgi?id=684208
2011-09-08 23:00:59 +02:00
Vojta Jina 4b4292edb8 style: fix some missing semi-colons and spaces, typos 2011-09-08 23:00:59 +02:00
Vojta Jina 292d5d1421 refactor($route): remove some odd code and rename allowReload to forceReload 2011-09-08 23:00:59 +02:00
Vojta Jina 66dec77555 fix(scenario): do not navigate if click event was cancelled
This is jQuery incompatible hack.
But we were doing monkey patching there anyway...

`$(...).trigger('click')` returns an array of return values, so that scenario
runner knows, whether the event default action was cancelled.

Without this fix, scenario runner was doing navigation even if JS code called
`event.preventDefault()`.

Note, this does not work in FF6
2011-09-08 23:00:59 +02:00
Vojta Jina 8fa79066e2 doc($location): $location docs + using $location guide 2011-09-08 23:00:59 +02:00
Vojta Jina 909415d5ed feat(scenario): browserTrigger returns false if preventDefault()
https://developer.mozilla.org/en/DOM/element.dispatchEvent
dispatchEvent method returns false if at least one of the event handlers called
preventDefault(), true otherwise.

It's helpful when browserTrigger method returns this value, as we can assert,
whether the default operation was cancelled or not.
2011-09-08 23:00:59 +02:00
Vojta Jina 4421f3d435 fix(docs): update docs to reflect new $location and fix e2e tests 2011-09-08 23:00:59 +02:00
Vojta Jina 22cb600280 fix($route): update $route to reflect $location changes
* update $route to reflect new $location
* add some more unit tests to $route
* fix some other failing unit tests
* redirect overrides the url now

Breaks $route custom redirect fn has only 3 params now
2011-09-08 23:00:59 +02:00
Vojta Jina 5ba227c7cd feat($location): $location service with html5 history api support
See documentation of $location for more info

Breaks $location has no properties, only get/set methods

Closes #168
Closes #146
Closes #281
Closes #234
2011-09-08 23:00:49 +02:00
Vojta Jina f37f0ea16e feat(jqLite): add event.isDefaultPrevented() as jQuery
Chrome's Event has defaultPrevented property, but other browsers haven't.
This is workaround for other browsers - same as jQuery.
2011-09-08 20:37:28 +02:00
Vojta Jina 91ccb4ba6e feat($browser): add $browser.baseHref()
This method abstracts <base href="" /> in document.head - returns the value.
If absolute href set, it converts the href to relative.
2011-09-08 20:37:28 +02:00
Vojta Jina d0f459c56f feat($sniffer): basic implementation of browser feature testing
This only extracts our 'hashchange' event and html5 history api detection from
$browser.

Closes #400
2011-09-08 20:37:28 +02:00
Vojta Jina cbedf55641 refactor($browser): extract MockWindow, use toHaveBeenCalledOnce 2011-09-08 20:36:33 +02:00
Vojta Jina 988ed451b5 feat($browser): jQuery style url method, onUrlChange event
This is just basic implementation of $browser.url, $browser.onUrlChange methods:

$browser.url() - returns current location.href

$browser.url('/new') - set url to /new
If supported, history.pushState is used, location.href property otherwise.

$browser.url('/new', true) - replace current url with /new
If supported, history.replaceState is used, location.replace otherwise.

$browser.onUrlChange is only fired when url is changed from the browser:
- user types into address bar
- user clicks on back/forward button
- user clicks on link

It's not fired when url is changed using $browser.url()

Breaks Removed $browser.setUrl(), $browser.getUrl(), use $browser.url()
Breaks Removed $browser.onHashChange(), use $browser.onUrlChange()
2011-09-08 20:36:33 +02:00
Vojta Jina fc2f188d4d style(filter): Couple of missing spaces, semi-colons, add empty lines 2011-09-08 17:59:52 +02:00
Vojta Jina 4b1913c5ec fix(filter.currency): Return empty string for non-numbers 2011-09-08 17:59:45 +02:00
Igor Minar 06534413d3 fix(ng:options): ng:change should be called after the new val is set
Closes #547
2011-09-07 23:37:37 -07:00
Igor Minar e54909f5ef fix(docs): use window.execScript instead of window.eval on IE
IE's window.eval doesn't execute in the global context, so we have to
use window.execScript instead which works like window.eval on normal
browsers. However execScript throws an exception when an empty string is
passed in, so I created a workaround with a workaround.
2011-09-06 14:57:37 -07:00
Vojta Jina 79f2512ba7 chore(config): Remove updateView from jstd config
This should have been part of 42062dab34
2011-09-06 17:36:53 +02:00
Vojta Jina b0eb831bce fix($browser.xhr): not convert 0 status to 200 2011-09-05 23:53:53 +02:00
Igor Minar 7f0b97e02c test(jsonp): fixing jsonp e2e tests
- buzz api keeps on throttling our requests which makes our build fail
  so I'm disabling the buzz demo e2e test
- the $xhr service jsonp test was modified to use jsonp on angularjs.org
  instead of buzz api for the same reason as mentioned above
2011-09-02 16:17:05 -07:00
Igor Minar fc7f1ef6a0 chore(version.yaml): preparing the 0.10.1 inexorable-juggernaut iteration 2011-09-02 15:41:41 -07:00
1120 changed files with 138414 additions and 52362 deletions
+4
View File
@@ -0,0 +1,4 @@
{
"directory": "bower_components",
"json": "bower.json"
}
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot; factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; id=&quot;1262905463390_2&quot; label=&quot;workingSet&quot; name=&quot;workingSet&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/angular.js/test&quot; type=&quot;2&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/angular.js/src&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/angular.js}/test.sh"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/angular.js}"/>
</launchConfiguration>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/angular.js/perf&quot; type=&quot;2&quot;/&gt;&#10;&lt;item path=&quot;/angular.js/src&quot; type=&quot;2&quot;/&gt;&#10;&lt;/resources&gt;}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/angular.js/perf.sh}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/angular.js}"/>
</launchConfiguration>
-11
View File
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/angular.js/build&quot; type=&quot;2&quot;/&gt;&#10;&lt;/resources&gt;}"/>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/angular.js/docs&quot; type=&quot;2&quot;/&gt;&#10;&lt;item path=&quot;/angular.js/src&quot; type=&quot;2&quot;/&gt;&#10;&lt;/resources&gt;}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/angular.js/gen_docs.sh}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/angular.js}"/>
</launchConfiguration>
-7
View File
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/angular.js/docs&quot; type=&quot;2&quot;/&gt;&#10;&lt;/resources&gt;}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/angular.js/gen_docs.sh}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/angular.js}"/>
</launchConfiguration>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/angular.js/lib/jsl/jsl}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-conf lib/jsl/jsl.default.conf"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/angular.js}"/>
</launchConfiguration>
+9 -4
View File
@@ -1,6 +1,4 @@
build/
angularjs.netrc
jstd.log
/build/
.DS_Store
gen_docs.disable
test.disable
@@ -9,4 +7,11 @@ performance/temp*.html
.idea/workspace.xml
*~
angular.js.tmproj
node_modules
/node_modules/
/components/
/bower_components/
angular.xcodeproj
.idea
.agignore
libpeerconnection.log
npm-debug.log
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>angular.js</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/docs.launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/JSTD_Tests.launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/JSTD_perf.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="test/" kind="src" path="src"/>
<classpathentry excluding="docs-data.js|docs-scenario.js" kind="src" path="docs"/>
<classpathentry excluding="test/" kind="src" path="test"/>
<classpathentry kind="src" path="test/test"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
@@ -1,16 +0,0 @@
#Mon Jan 24 10:31:47 PST 2011
activeContentFilterList=*.makefile,makefile,*.Makefile,Makefile,Makefile.*,*.mk,MANIFEST.MF
addNewLine=true
convertActionOnSaave=AnyEdit.CnvrtTabToSpaces
eclipse.preferences.version=1
inActiveContentFilterList=
javaTabWidthForJava=true
org.eclipse.jdt.ui.editor.tab.width=2
projectPropsEnabled=false
removeTrailingSpaces=true
replaceAllSpaces=false
replaceAllTabs=false
saveAndAddLine=true
saveAndConvert=true
saveAndTrim=true
useModulo4Tabs=false
@@ -1 +0,0 @@
org.eclipse.wst.jsdt.launching.JRE_CONTAINER
@@ -1 +0,0 @@
Global
+12
View File
@@ -0,0 +1,12 @@
language: node_js
node_js:
- 0.8
env:
global:
- SAUCE_USERNAME=angular-ci
- SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
- SAUCE_CONNECT_READY_FILE=/tmp/sauce-connect-ready
script:
- ./travis_build.sh
+2657 -54
View File
File diff suppressed because it is too large Load Diff
+32
View File
@@ -0,0 +1,32 @@
## Submitting issues
If you have questions about how to use AngularJS, please direct these to the
[Google Group][groups] discussion list or [StackOverflow][stackoverflow]. We are
also available on [IRC][irc].
### Guidelines
* Search the archive first, it's likely that your question was already answered.
* A live example demonstrating your problem or question, will get an answer faster.
* Create one using this [template][template]
* If you get help, help others. Good karma rulez!
If your issue appears to be a bug, and hasn't been reported, open a new issue.
Help us to maximize the effort we can spend fixing issues and adding new
features, by not reporting duplicate issues.
[stackoverflow]: http://stackoverflow.com/questions/tagged/angularjs
[groups]: https://groups.google.com/forum/?fromgroups#!forum/angular
[irc]: http://webchat.freenode.net/?channels=angularjs&uio=d4
[template]: http://plnkr.co/edit/gist:3510140
## Contributing to Source Code
We'd love for you to contribute to our source code and to make AngularJS even
better than it is today!
Please read the [contribution guidelines][contribute] to learn about how to submit code as well as
other useful info like how to build and test AngularJS code.
[list]: https://groups.google.com/forum/?fromgroups#!forum/angular
[contribute]: http://docs.angularjs.org/misc/contribute
+247
View File
@@ -0,0 +1,247 @@
var files = require('./angularFiles').files;
var util = require('./lib/grunt/utils.js');
module.exports = function(grunt) {
//grunt plugins
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-jasmine-node');
grunt.loadNpmTasks('grunt-ddescribe-iit');
grunt.loadNpmTasks('grunt-merge-conflict');
grunt.loadNpmTasks('grunt-parallel');
grunt.loadTasks('lib/grunt');
var NG_VERSION = util.getVersion();
var dist = 'angular-'+ NG_VERSION.full;
//global beforeEach
util.init();
//config
grunt.initConfig({
NG_VERSION: NG_VERSION,
parallel: {
travis: {
options: {
stream: true
},
tasks: [
util.parallelTask('tests:docs'),
util.parallelTask('tests:modules'),
util.parallelTask('tests:jquery'),
util.parallelTask('tests:jqlite'),
util.parallelTask('tests:end2end')
]
}
},
connect: {
devserver: {
options: {
port: 8000,
hostname: '0.0.0.0',
base: '.',
keepalive: true,
middleware: function(connect, options){
return [
//uncomment to enable CSP
// util.csp(),
util.rewrite(),
connect.favicon('images/favicon.ico'),
connect.static(options.base),
connect.directory(options.base)
];
}
}
},
testserver: {
options: {
middleware: function(connect, options){
return [
function(req, resp, next) {
// cache get requests to speed up tests on travis
if (req.method === 'GET') {
resp.setHeader('Cache-control', 'public, max-age=3600');
}
next();
},
connect.favicon('images/favicon.ico'),
connect.static(options.base)
];
}
}
}
},
tests: {
jqlite: 'karma-jqlite.conf.js',
jquery: 'karma-jquery.conf.js',
docs: 'karma-docs.conf.js',
modules: 'karma-modules.conf.js',
//NOTE run grunt test:e2e instead and it will start a webserver for you
end2end: 'karma-e2e.conf.js'
},
autotest: {
jqlite: 'karma-jqlite.conf.js',
jquery: 'karma-jquery.conf.js',
modules: 'karma-modules.conf.js',
docs: 'karma-docs.conf.js'
},
clean: {build: ['build']},
build: {
scenario: {
dest: 'build/angular-scenario.js',
src: [
'bower_components/jquery/jquery.js',
util.wrap([files['angularSrc'], files['angularScenario']], 'ngScenario/angular')
],
styles: {
css: ['css/angular.css', 'css/angular-scenario.css']
}
},
angular: {
dest: 'build/angular.js',
src: util.wrap([files['angularSrc']], 'angular'),
styles: {
css: ['css/angular.css'],
minify: true
}
},
loader: {
dest: 'build/angular-loader.js',
src: util.wrap(['src/loader.js'], 'loader')
},
touch: {
dest: 'build/angular-touch.js',
src: util.wrap([
'src/ngTouch/touch.js',
'src/ngTouch/swipe.js',
'src/ngTouch/directive/ngClick.js',
'src/ngTouch/directive/ngSwipe.js'
], 'module')
},
mocks: {
dest: 'build/angular-mocks.js',
src: ['src/ngMock/angular-mocks.js'],
strict: false
},
sanitize: {
dest: 'build/angular-sanitize.js',
src: util.wrap([
'src/ngSanitize/sanitize.js',
'src/ngSanitize/filter/linky.js'
], 'module')
},
resource: {
dest: 'build/angular-resource.js',
src: util.wrap(['src/ngResource/resource.js'], 'module')
},
animate: {
dest: 'build/angular-animate.js',
src: util.wrap(['src/ngAnimate/animate.js'], 'module')
},
route: {
dest: 'build/angular-route.js',
src: util.wrap([
'src/ngRoute/routeUtils.js',
'src/ngRoute/route.js',
'src/ngRoute/routeParams.js',
'src/ngRoute/directive/ngView.js'
], 'module')
},
cookies: {
dest: 'build/angular-cookies.js',
src: util.wrap(['src/ngCookies/cookies.js'], 'module')
}
},
min: {
angular: 'build/angular.js',
animate: 'build/angular-animate.js',
cookies: 'build/angular-cookies.js',
loader: 'build/angular-loader.js',
touch: 'build/angular-touch.js',
resource: 'build/angular-resource.js',
route: 'build/angular-route.js',
sanitize: 'build/angular-sanitize.js'
},
docs: {
process: ['build/docs/*.html', 'build/docs/.htaccess']
},
"jasmine-node": {
run: { spec: 'docs/spec' }
},
"ddescribe-iit": {
files: [
'test/**/*.js',
'!test/ngScenario/DescribeSpec.js'
]
},
"merge-conflict": {
files: [
'src/**/*',
'test/**/*',
'docs/**/*',
'css/**/*'
]
},
copy: {
i18n: {
files: [
{ src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
]
}
},
compress: {
build: {
options: {archive: 'build/' + dist +'.zip'},
src: ['**'], cwd: 'build', expand: true, dot: true, dest: dist + '/'
}
},
write: {
versionTXT: {file: 'build/version.txt', val: NG_VERSION.full},
versionJSON: {file: 'build/version.json', val: JSON.stringify(NG_VERSION)}
}
});
//alias tasks
grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['package','test:unit', 'tests:docs', 'test:e2e']);
grunt.registerTask('test:jqlite', 'Run the unit tests with Karma' , ['tests:jqlite']);
grunt.registerTask('test:jquery', 'Run the jQuery unit tests with Karma', ['tests:jquery']);
grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', ['tests:modules']);
grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['tests:jqlite', 'tests:jquery', 'tests:modules']);
grunt.registerTask('test:e2e', 'Run the end to end tests with Karma and keep a test server running in the background', ['connect:testserver', 'tests:end2end']);
grunt.registerTask('test:docgen', ['jasmine-node']);
grunt.registerTask('minify', ['bower','clean', 'build', 'minall']);
grunt.registerTask('webserver', ['connect:devserver']);
grunt.registerTask('package', ['bower','clean', 'buildall', 'minall', 'collect-errors', 'docs', 'copy', 'write', 'compress']);
grunt.registerTask('ci-checks', ['ddescribe-iit', 'merge-conflict']);
grunt.registerTask('default', ['package']);
};
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License
Copyright (c) 2010 Adam Abrons and Misko Hevery http://getangular.com
Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+33 -6
View File
@@ -1,12 +1,39 @@
Angular
======
AngularJS
=========
Compiling
AngularJS lets you write client-side web applications as if you had a smarter browser. It lets you
use good old HTML (or HAML, Jade and friends!) as your template language and lets you extend HTMLs
syntax to express your applications components clearly and succinctly. It automatically
synchronizes data from your UI (view) with your JavaScript objects (model) through 2-way data
binding. To help you structure your application better and make it easy to test, AngularJS teaches
the browser how to do dependency injection and inversion of control. Oh yeah and it also helps with
server-side communication, taming async callbacks with promises and deferreds; and make client-side
navigation and deeplinking with hashbang urls or HTML5 pushState a piece of cake. The best of all:
it makes development fun!
* Web site: http://angularjs.org
* 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
Building AngularJS
---------
rake compile
[Once you have your environment setup](http://docs.angularjs.org/misc/contribute) just run:
grunt package
Running Tests
-------------
rake server:start
rake test
To execute all unit tests, use:
grunt test:unit
To execute end-to-end (e2e) tests, use:
grunt package
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).
-381
View File
@@ -1,381 +0,0 @@
require 'yaml'
include FileUtils
ANGULAR = [
'src/Angular.js',
'src/JSON.js',
'src/Compiler.js',
'src/Scope.js',
'src/Injector.js',
'src/parser.js',
'src/Resource.js',
'src/Browser.js',
'src/sanitizer.js',
'src/jqLite.js',
'src/apis.js',
'src/filters.js',
'src/formatters.js',
'src/validators.js',
'src/service/cookieStore.js',
'src/service/cookies.js',
'src/service/defer.js',
'src/service/document.js',
'src/service/exceptionHandler.js',
'src/service/hover.js',
'src/service/invalidWidgets.js',
'src/service/location.js',
'src/service/log.js',
'src/service/resource.js',
'src/service/route.js',
'src/service/routeParams.js',
'src/service/window.js',
'src/service/xhr.bulk.js',
'src/service/xhr.cache.js',
'src/service/xhr.error.js',
'src/service/xhr.js',
'src/service/locale.js',
'src/directives.js',
'src/markups.js',
'src/widgets.js',
'src/AngularPublic.js',
]
ANGULAR_SCENARIO = [
'src/scenario/Scenario.js',
'src/scenario/Application.js',
'src/scenario/Describe.js',
'src/scenario/Future.js',
'src/scenario/ObjectModel.js',
'src/scenario/Describe.js',
'src/scenario/Runner.js',
'src/scenario/SpecRunner.js',
'src/scenario/dsl.js',
'src/scenario/matchers.js',
'src/scenario/output/Html.js',
'src/scenario/output/Json.js',
'src/scenario/output/Xml.js',
'src/scenario/output/Object.js'
]
BUILD_DIR = 'build'
task :default => [:compile, :test]
desc 'Init the build workspace'
task :init do
FileUtils.mkdir(BUILD_DIR) unless File.directory?(BUILD_DIR)
v = YAML::load( File.open( 'version.yaml' ) )
match = v['version'].match(/^([^-]*)(-snapshot)?$/)
NG_VERSION = Struct.new(:full, :major, :minor, :dot, :codename).
new(match[1] + (match[2] ? ('-' + %x(git rev-parse HEAD)[0..7]) : ''),
match[1].split('.')[0],
match[1].split('.')[1],
match[1].split('.')[2],
v['codename'])
end
desc 'Clean Generated Files'
task :clean do
FileUtils.rm_r(BUILD_DIR, :force => true)
FileUtils.mkdir(BUILD_DIR)
end
desc 'Compile Scenario'
task :compile_scenario => :init do
deps = [
'lib/jquery/jquery-1.4.2.js',
'src/scenario/angular.prefix',
ANGULAR,
ANGULAR_SCENARIO,
'src/scenario/angular.suffix',
]
concat = 'cat ' + deps.flatten.join(' ')
File.open(path_to('angular-scenario.js'), 'w') do |f|
f.write(%x{#{concat}}.gsub('"NG_VERSION_FULL"', NG_VERSION.full))
f.write(gen_css('css/angular.css') + "\n")
f.write(gen_css('css/angular-scenario.css'))
end
end
desc 'Compile JSTD Scenario Adapter'
task :compile_jstd_scenario_adapter => :init do
deps = [
'src/jstd-scenario-adapter/angular.prefix',
'src/jstd-scenario-adapter/Adapter.js',
'src/jstd-scenario-adapter/angular.suffix',
]
concat = 'cat ' + deps.flatten.join(' ')
File.open(path_to('jstd-scenario-adapter.js'), 'w') do |f|
f.write(%x{#{concat}}.gsub('"NG_VERSION_FULL"', NG_VERSION.full))
end
# TODO(vojta) use jstd configuration when implemented
# (instead of including jstd-adapter-config.js)
File.open(path_to('jstd-scenario-adapter-config.js'), 'w') do |f|
f.write("/**\r\n" +
" * Configuration for jstd scenario adapter \n */\n" +
"var jstdScenarioAdapter = {\n relativeUrlPrefix: '/build/docs/'\n};\n")
end
end
desc 'Generate IE css js patch'
task :generate_ie_compat => :init do
css = File.open('css/angular.css', 'r') {|f| f.read }
# finds all css rules that contain backround images and extracts the rule name(s), content type of
# the image and base64 encoded image data
r = /\n([^\{\n]+)\s*\{[^\}]*background-image:\s*url\("data:([^;]+);base64,([^"]+)"\);[^\}]*\}/
images = css.scan(r)
# create a js file with multipart header containing the extracted images. the entire file *must*
# be CRLF (\r\n) delimited
File.open(path_to('angular-ie-compat.js'), 'w') do |f|
f.write("/*\r\n" +
"Content-Type: multipart/related; boundary=\"_\"\r\n" +
"\r\n")
images.each_index do |idx|
f.write("--_\r\n" +
"Content-Location:img#{idx}\r\n" +
"Content-Transfer-Encoding:base64\r\n" +
"\r\n" +
images[idx][2] + "\r\n")
end
f.write("--_--\r\n" +
"*/\r\n")
# generate a css string containing *background-image rules for IE that point to the mime type
# images in the header
cssString = ''
images.each_index do |idx|
cssString += "#{images[idx][0]}{*background-image:url(\"mhtml:' + jsUri + '!img#{idx}\")}"
end
# generate a javascript closure that contains a function which will append the generated css
# string as a stylesheet to the current html document
jsString = "(function(){ \r\n" +
" var jsUri = document.location.href.replace(/\\/[^\\\/]+(#.*)?$/, '/') + \r\n" +
" document.getElementById('ng-ie-compat').src,\r\n" +
" css = '#{cssString}',\r\n" +
" s = document.createElement('style'); \r\n" +
"\r\n" +
" s.setAttribute('type', 'text/css'); \r\n" +
"\r\n" +
" if (s.styleSheet) { \r\n" +
" s.styleSheet.cssText = css; \r\n" +
" } else { \r\n" +
" s.appendChild(document.createTextNode(css)); \r\n" +
" } \r\n" +
" document.getElementsByTagName('head')[0].appendChild(s); \r\n" +
"})();\r\n"
f.write(jsString)
end
end
desc 'Compile JavaScript'
task :compile => [:init, :compile_scenario, :compile_jstd_scenario_adapter, :generate_ie_compat] do
deps = [
'src/angular.prefix',
ANGULAR,
'src/angular.suffix',
]
File.open(path_to('angular.js'), 'w') do |f|
concat = 'cat ' + deps.flatten.join(' ')
content = %x{#{concat}}.
gsub('"NG_VERSION_FULL"', NG_VERSION.full).
gsub('"NG_VERSION_MAJOR"', NG_VERSION.major).
gsub('"NG_VERSION_MINOR"', NG_VERSION.minor).
gsub('"NG_VERSION_DOT"', NG_VERSION.dot).
gsub('"NG_VERSION_CODENAME"', NG_VERSION.codename).
gsub(/^\s*['"]use strict['"];?\s*$/, ''). # remove all file-specific strict mode flags
gsub(/'USE STRICT'/, "'use strict'") # rename the placeholder in angular.prefix
f.write(content)
f.write(gen_css('css/angular.css', true))
end
%x(java -jar lib/closure-compiler/compiler.jar \
--compilation_level SIMPLE_OPTIMIZATIONS \
--language_in ECMASCRIPT5_STRICT \
--js #{path_to('angular.js')} \
--js_output_file #{path_to('angular.min.js')})
FileUtils.cp_r 'i18n/locale', path_to('i18n')
end
desc 'Generate docs'
task :docs => [:init] do
`node docs/src/gen-docs.js`
File.open(path_to('docs/.htaccess'), File::RDWR) do |f|
text = f.read
f.truncate 0
f.rewind
f.write text.sub('"NG_VERSION_FULL"', NG_VERSION.full)
end
end
desc 'Create angular distribution'
task :package => [:clean, :compile, :docs] do
tarball = "angular-#{NG_VERSION.full}.tgz"
pkg_dir = path_to("pkg/angular-#{NG_VERSION.full}")
FileUtils.rm_r(path_to('pkg'), :force => true)
FileUtils.mkdir_p(pkg_dir)
['src/angular-mocks.js',
path_to('angular.js'),
path_to('angular.min.js'),
path_to('angular-ie-compat.js'),
path_to('angular-scenario.js'),
path_to('jstd-scenario-adapter.js'),
path_to('jstd-scenario-adapter-config.js'),
].each do |src|
dest = src.gsub(/^[^\/]+\//, '').gsub(/((\.min)?\.js)$/, "-#{NG_VERSION.full}\\1")
FileUtils.cp(src, pkg_dir + '/' + dest)
end
FileUtils.cp_r path_to('i18n'), "#{pkg_dir}/i18n-#{NG_VERSION.full}"
FileUtils.cp_r path_to('docs'), "#{pkg_dir}/docs-#{NG_VERSION.full}"
File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/index.html", File::RDWR) do |f|
text = f.read
f.truncate 0
f.rewind
f.write text.sub('angular.min.js', "angular-#{NG_VERSION.full}.min.js")
end
File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/index-jq.html", File::RDWR) do |f|
text = f.read
f.truncate 0
f.rewind
f.write text.sub('angular.min.js', "angular-#{NG_VERSION.full}.min.js")
end
File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/docs-scenario.html", File::RDWR) do |f|
text = f.read
f.truncate 0
f.rewind
f.write text.sub('angular-scenario.js', "angular-scenario-#{NG_VERSION.full}.js")
end
File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/appcache.manifest", File::RDWR) do |f|
text = f.read
f.truncate 0
f.rewind
f.write text.sub('angular.min.js', "angular-#{NG_VERSION.full}.min.js")
end
File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/appcache-offline.manifest", File::RDWR) do |f|
text = f.read
f.truncate 0
f.rewind
f.write text.sub('angular.min.js', "angular-#{NG_VERSION.full}.min.js")
end
%x(tar -czf #{path_to(tarball)} -C #{path_to('pkg')} .)
FileUtils.cp path_to(tarball), pkg_dir
FileUtils.mv pkg_dir, path_to(['pkg', NG_VERSION.full])
puts "Package created: #{path_to(tarball)}"
end
namespace :server do
desc 'Run JsTestDriver Server'
task :start do
sh %x(java -jar lib/jstestdriver/JsTestDriver.jar --browser open --port 9876)
end
desc 'Run JavaScript tests against the server'
task :test do
sh %(java -jar lib/jstestdriver/JsTestDriver.jar --tests all)
end
end
desc 'Run JavaScript tests'
task :test do
sh %(java -jar lib/jstestdriver/JsTestDriver.jar --tests all --browser open --port 9876)
end
desc 'Lint'
task :lint do
out = %x(lib/jsl/jsl -conf lib/jsl/jsl.default.conf)
print out
end
desc 'push_angularjs'
task :push_angularjs => :compile do
sh %(cat angularjs.ftp | ftp -N angularjs.netrc angularjs.org)
end
###################
# utility methods #
###################
##
# generates css snippet from a given files and optionally applies simple minification rules
#
def gen_css(cssFile, minify = false)
css = ''
File.open(cssFile, 'r') do |f|
css = f.read
end
if minify
css.gsub! /\n/, ''
css.gsub! /\/\*.*?\*\//, ''
css.gsub! /:\s+/, ':'
css.gsub! /\s*\{\s*/, '{'
css.gsub! /\s*\}\s*/, '}'
css.gsub! /\s*\,\s*/, ','
css.gsub! /\s*\;\s*/, ';'
end
#escape for js
css.gsub! /\\/, "\\\\\\"
css.gsub! /'/, "\\\\'"
css.gsub! /\n/, "\\n"
return %Q{angular.element(document).find('head').append('<style type="text/css">#{css}</style>');}
end
##
# returns path to the file in the build directory
#
def path_to(filename)
return File.join(BUILD_DIR, *filename)
end
Vendored Executable
+195
View File
@@ -0,0 +1,195 @@
angularFiles = {
'angularSrc': [
'src/minErr.js',
'src/Angular.js',
'src/loader.js',
'src/AngularPublic.js',
'src/jqLite.js',
'src/apis.js',
'src/auto/injector.js',
'src/ng/anchorScroll.js',
'src/ng/animate.js',
'src/ng/browser.js',
'src/ng/cacheFactory.js',
'src/ng/compile.js',
'src/ng/controller.js',
'src/ng/document.js',
'src/ng/exceptionHandler.js',
'src/ng/http.js',
'src/ng/httpBackend.js',
'src/ng/interpolate.js',
'src/ng/locale.js',
'src/ng/location.js',
'src/ng/log.js',
'src/ng/parse.js',
'src/ng/q.js',
'src/ng/rootScope.js',
'src/ng/sce.js',
'src/ng/sniffer.js',
'src/ng/timeout.js',
'src/ng/urlUtils.js',
'src/ng/window.js',
'src/ng/filter.js',
'src/ng/filter/filter.js',
'src/ng/filter/filters.js',
'src/ng/filter/limitTo.js',
'src/ng/filter/orderBy.js',
'src/ng/directive/directives.js',
'src/ng/directive/a.js',
'src/ng/directive/booleanAttrs.js',
'src/ng/directive/form.js',
'src/ng/directive/input.js',
'src/ng/directive/ngBind.js',
'src/ng/directive/ngClass.js',
'src/ng/directive/ngCloak.js',
'src/ng/directive/ngController.js',
'src/ng/directive/ngCsp.js',
'src/ng/directive/ngEventDirs.js',
'src/ng/directive/ngIf.js',
'src/ng/directive/ngInclude.js',
'src/ng/directive/ngInit.js',
'src/ng/directive/ngNonBindable.js',
'src/ng/directive/ngPluralize.js',
'src/ng/directive/ngRepeat.js',
'src/ng/directive/ngShowHide.js',
'src/ng/directive/ngStyle.js',
'src/ng/directive/ngSwitch.js',
'src/ng/directive/ngTransclude.js',
'src/ng/directive/script.js',
'src/ng/directive/select.js',
'src/ng/directive/style.js'
],
'angularSrcModules': [
'src/ngAnimate/animate.js',
'src/ngCookies/cookies.js',
'src/ngResource/resource.js',
'src/ngRoute/routeUtils.js',
'src/ngRoute/route.js',
'src/ngRoute/routeParams.js',
'src/ngRoute/directive/ngView.js',
'src/ngSanitize/sanitize.js',
'src/ngSanitize/filter/linky.js',
'src/ngMock/angular-mocks.js',
'src/ngTouch/touch.js',
'src/ngTouch/swipe.js',
'src/ngTouch/directive/ngClick.js',
'src/ngTouch/directive/ngSwipe.js',
'docs/components/angular-bootstrap/bootstrap.js'
],
'angularScenario': [
'src/ngScenario/Scenario.js',
'src/ngScenario/browserTrigger.js',
'src/ngScenario/Application.js',
'src/ngScenario/Describe.js',
'src/ngScenario/Future.js',
'src/ngScenario/ObjectModel.js',
'src/ngScenario/Runner.js',
'src/ngScenario/SpecRunner.js',
'src/ngScenario/dsl.js',
'src/ngScenario/matchers.js',
'src/ngScenario/output/Html.js',
'src/ngScenario/output/Json.js',
'src/ngScenario/output/Xml.js',
'src/ngScenario/output/Object.js'
],
'angularTest': [
'test/testabilityPatch.js',
'test/matchers.js',
'test/ngScenario/*.js',
'test/ngScenario/output/*.js',
'test/*.js',
'test/auto/*.js',
'test/ng/**/*.js',
'test/ngAnimate/*.js',
'test/ngCookies/*.js',
'test/ngResource/*.js',
'test/ngRoute/**/*.js',
'test/ngSanitize/**/*.js',
'test/ngMock/*.js',
'test/ngTouch/**/*.js'
],
'karma': [
'bower_components/jquery/jquery.js',
'test/jquery_remove.js',
'@angularSrc',
'src/publishExternalApis.js',
'@angularSrcModules',
'@angularScenario',
'@angularTest',
'example/personalLog/*.js',
'example/personalLog/test/*.js'
],
'karmaExclude': [
'test/jquery_alias.js',
'src/angular-bootstrap.js',
'src/ngScenario/angular-bootstrap.js'
],
'karmaScenario': [
'build/angular-scenario.js',
'build/docs/docs-scenario.js'
],
"karmaModules": [
'build/angular.js',
'@angularSrcModules',
'src/ngScenario/browserTrigger.js',
'test/matchers.js',
'test/testabilityPatch.js',
'test/ngMock/*.js',
'test/ngCookies/*.js',
'test/ngRoute/**/*.js',
'test/ngResource/*.js',
'test/ngSanitize/**/*.js',
'test/ngTouch/**/*.js'
],
'karmaJquery': [
'bower_components/jquery/jquery.js',
'test/jquery_alias.js',
'@angularSrc',
'src/publishExternalApis.js',
'@angularSrcModules',
'@angularScenario',
'@angularTest',
'example/personalLog/*.js',
'example/personalLog/test/*.js'
],
'karmaJqueryExclude': [
'src/angular-bootstrap.js',
'src/ngScenario/angular-bootstrap.js',
'test/jquery_remove.js'
]
};
if (exports) {
exports.files = angularFiles;
exports.mergeFilesFor = function() {
var files = [];
Array.prototype.slice.call(arguments, 0).forEach(function(filegroup) {
angularFiles[filegroup].forEach(function(file) {
// replace @ref
var match = file.match(/^\@(.*)/);
if (match) {
files = files.concat(angularFiles[match[1]]);
} else {
files.push(file);
}
});
});
return files;
};
}
-5
View File
@@ -1,5 +0,0 @@
bin
cd angularjs.org/ng
put angular-debug.js js/angular-debug.js
put angular-minified.js js/angular-minified.js
put angular-scenario.js js/angular-scenario.js
+12
View File
@@ -0,0 +1,12 @@
{
"name": "AngularJS",
"devDependencies": {
"jquery": "git://github.com/components/jquery.git#v1.8.3",
"lunr.js": "0.4.0",
"google-code-prettify": "1.0.0",
"components-font-awesome": "3.1.0",
"bootstrap": "https://raw.github.com/twbs/bootstrap/v2.0.2/docs/assets/bootstrap.zip",
"closure-compiler": "https://closure-compiler.googlecode.com/files/compiler-20130603.zip",
"ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.1/assets/ng-closure-runner.zip"
}
}
Executable
+210
View File
@@ -0,0 +1,210 @@
#!/usr/bin/env node
// TODO(vojta): pre-commit hook for validating messages
// TODO(vojta): report errors, currently Q silence everything which really sucks
var child = require('child_process');
var fs = require('fs');
var util = require('util');
var q = require('qq');
var GIT_LOG_CMD = 'git log --grep="%s" -E --format=%s %s..HEAD';
var GIT_TAG_CMD = 'git describe --tags --abbrev=0';
var HEADER_TPL = '<a name="%s"></a>\n# %s (%s)\n\n';
var LINK_ISSUE = '[#%s](https://github.com/angular/angular.js/issues/%s)';
var LINK_COMMIT = '[%s](https://github.com/angular/angular.js/commit/%s)';
var EMPTY_COMPONENT = '$$';
var MAX_SUBJECT_LENGTH = 80;
var warn = function() {
console.log('WARNING:', util.format.apply(null, arguments));
};
var parseRawCommit = function(raw) {
if (!raw) return null;
var lines = raw.split('\n');
var msg = {}, match;
msg.hash = lines.shift();
msg.subject = lines.shift();
msg.closes = [];
msg.breaks = [];
lines.forEach(function(line) {
match = line.match(/(?:Closes|Fixes)\s#(\d+)/);
if (match) msg.closes.push(parseInt(match[1]));
});
match = raw.match(/BREAKING CHANGE:([\s\S]*)/);
if (match) {
msg.breaking = match[1];
}
msg.body = lines.join('\n');
match = msg.subject.match(/^(.*)\((.*)\)\:\s(.*)$/);
if (!match || !match[1] || !match[3]) {
warn('Incorrect message: %s %s', msg.hash, msg.subject);
return null;
}
if (match[3].length > MAX_SUBJECT_LENGTH) {
warn('Too long subject: %s %s', msg.hash, msg.subject);
match[3] = match[3].substr(0, MAX_SUBJECT_LENGTH);
}
msg.type = match[1];
msg.component = match[2];
msg.subject = match[3];
return msg;
};
var linkToIssue = function(issue) {
return util.format(LINK_ISSUE, issue, issue);
};
var linkToCommit = function(hash) {
return util.format(LINK_COMMIT, hash.substr(0, 8), hash);
};
var currentDate = function() {
var now = new Date();
var pad = function(i) {
return ('0' + i).substr(-2);
};
return util.format('%d-%s-%s', now.getFullYear(), pad(now.getMonth() + 1), pad(now.getDate()));
};
var printSection = function(stream, title, section, printCommitLinks) {
printCommitLinks = printCommitLinks === undefined ? true : printCommitLinks;
var components = Object.getOwnPropertyNames(section).sort();
if (!components.length) return;
stream.write(util.format('\n## %s\n\n', title));
components.forEach(function(name) {
var prefix = '-';
var nested = section[name].length > 1;
if (name !== EMPTY_COMPONENT) {
if (nested) {
stream.write(util.format('- **%s:**\n', name));
prefix = ' -';
} else {
prefix = util.format('- **%s:**', name);
}
}
section[name].forEach(function(commit) {
if (printCommitLinks) {
stream.write(util.format('%s %s\n (%s', prefix, commit.subject, linkToCommit(commit.hash)));
if (commit.closes.length) {
stream.write(',\n ' + commit.closes.map(linkToIssue).join(', '));
}
stream.write(')\n');
} else {
stream.write(util.format('%s %s', prefix, commit.subject));
}
});
});
stream.write('\n');
};
var readGitLog = function(grep, from) {
var deferred = q.defer();
// TODO(vojta): if it's slow, use spawn and stream it instead
child.exec(util.format(GIT_LOG_CMD, grep, '%H%n%s%n%b%n==END==', from), function(code, stdout, stderr) {
var commits = [];
stdout.split('\n==END==\n').forEach(function(rawCommit) {
var commit = parseRawCommit(rawCommit);
if (commit) commits.push(commit);
});
deferred.resolve(commits);
});
return deferred.promise;
};
var writeChangelog = function(stream, commits, version) {
var sections = {
fix: {},
feat: {},
breaks: {}
};
sections.breaks[EMPTY_COMPONENT] = [];
commits.forEach(function(commit) {
var section = sections[commit.type];
var component = commit.component || EMPTY_COMPONENT;
if (section) {
section[component] = section[component] || [];
section[component].push(commit);
}
if (commit.breaking) {
sections.breaks[component] = sections.breaks[component] || [];
sections.breaks[component].push({
subject: util.format("due to %s,\n %s", linkToCommit(commit.hash), commit.breaking),
hash: commit.hash,
closes: []
});
};
});
stream.write(util.format(HEADER_TPL, version, version, currentDate()));
printSection(stream, 'Bug Fixes', sections.fix);
printSection(stream, 'Features', sections.feat);
printSection(stream, 'Breaking Changes', sections.breaks, false);
}
var getPreviousTag = function() {
var deferred = q.defer();
child.exec(GIT_TAG_CMD, function(code, stdout, stderr) {
if (code) deferred.reject('Cannot get the previous tag.');
else deferred.resolve(stdout.replace('\n', ''));
});
return deferred.promise;
};
var generate = function(version, file) {
getPreviousTag().then(function(tag) {
console.log('Reading git log since', tag);
readGitLog('^fix|^feat|BREAKING', tag).then(function(commits) {
console.log('Parsed', commits.length, 'commits');
console.log('Generating changelog to', file || 'stdout', '(', version, ')');
writeChangelog(file ? fs.createWriteStream(file) : process.stdout, commits, version);
});
});
};
// publish for testing
exports.parseRawCommit = parseRawCommit;
// hacky start if not run by jasmine :-D
if (process.argv.join('').indexOf('jasmine-node') === -1) {
generate(process.argv[2], process.argv[3]);
}
+43
View File
@@ -0,0 +1,43 @@
describe('changelog.js', function() {
var ch = require('./changelog');
describe('parseRawCommit', function() {
it('should parse raw commit', function() {
var msg = ch.parseRawCommit(
'9b1aff905b638aa274a5fc8f88662df446d374bd\n' +
'feat(scope): broadcast $destroy event on scope destruction\n' +
'perf testing shows that in chrome this change adds 5-15% overhead\n' +
'when destroying 10k nested scopes where each scope has a $destroy listener\n');
expect(msg.type).toBe('feat');
expect(msg.hash).toBe('9b1aff905b638aa274a5fc8f88662df446d374bd');
expect(msg.subject).toBe('broadcast $destroy event on scope destruction');
expect(msg.body).toBe('perf testing shows that in chrome this change adds 5-15% overhead\n' +
'when destroying 10k nested scopes where each scope has a $destroy listener\n')
expect(msg.component).toBe('scope');
});
it('should parse closed issues', function() {
var msg = ch.parseRawCommit(
'13f31602f396bc269076ab4d389cfd8ca94b20ba\n' +
'feat(ng-list): Allow custom separator\n' +
'bla bla bla\n\n' +
'Closes #123\nCloses #25\n');
expect(msg.closes).toEqual([123, 25]);
});
it('should parse breaking changes', function() {
var msg = ch.parseRawCommit(
'13f31602f396bc269076ab4d389cfd8ca94b20ba\n' +
'feat(ng-list): Allow custom separator\n' +
'bla bla bla\n\n' +
'BREAKING CHANGE: first breaking change\nsomething else\n' +
'another line with more info\n');
expect(msg.breaking).toEqual(' first breaking change\nsomething else\nanother line with more info\n');
});
});
});
+80
View File
@@ -0,0 +1,80 @@
<a name="v1.0.0rc3"></a>
# v1.0.0rc3 (2012-03-27)
## Bug Fixes
- **$compile:**
- create new (isolate) scopes for directives on root elements ([5390fb37](https://github.com/angular/angular.js/commit/5390fb37d2c01937922613fc57df4986af521787), closes [#817](https://github.com/angular/angular.js/issues/817))
- don't touch static element attributes ([9cb2195e](https://github.com/angular/angular.js/commit/9cb2195e61a78e99020ec19d687a221ca88b5900))
- Merge interpolated css class when replacing an element ([f49eaf8b](https://github.com/angular/angular.js/commit/f49eaf8bf2df5f4e0e82d6c89e849a4f82c8d414))
- **$http:**
- don't send Content-Type header when no data ([1a5bebd9](https://github.com/angular/angular.js/commit/1a5bebd927ecd22f9c34617642fdf58fe3f62efb), closes [#749](https://github.com/angular/angular.js/issues/749))
- **$log:**
- avoid console.log.apply calls in IE ([15213ec2](https://github.com/angular/angular.js/commit/15213ec212769837cb2b7e781ffc5bfd598d27ca), closes [#805](https://github.com/angular/angular.js/issues/805))
- **$resource:**
- support escaping of ':' in resource url ([6d6f8753](https://github.com/angular/angular.js/commit/6d6f875345e01f2c6c63ef95164f6f39e923da15))
- **compiler:**
- allow transclusion of root elements ([9918b748](https://github.com/angular/angular.js/commit/9918b748be01266eb10db39d51b4d3098d54ab66))
- **e2e runner:**
- fix typo that caused errors on IE8 ([ee5a5352](https://github.com/angular/angular.js/commit/ee5a5352fd4b94cedee6ef20d4bf2d43ce77e00b), closes [#806](https://github.com/angular/angular.js/issues/806))
- **forEach:**
- should ignore prototypically inherited properties ([8d7e6948](https://github.com/angular/angular.js/commit/8d7e6948496ff26ef1da8854ba02fcb8eebfed61), closes [#813](https://github.com/angular/angular.js/issues/813))
- **forms:**
- Remove double registering of form ([1faafa31](https://github.com/angular/angular.js/commit/1faafa31582c4e9413f48dc7d12f5b681f9fe9fd))
- Set ng-valid/ng-invalid correctly ([08bfea18](https://github.com/angular/angular.js/commit/08bfea183a850b29da270eac47f80b598cbe600f))
- **init:**
- use jQuery#ready for init if available ([cb2ad9ab](https://github.com/angular/angular.js/commit/cb2ad9abf24e6f855cc749efe3155bd7987ece9d), closes [#818](https://github.com/angular/angular.js/issues/818))
- **json:**
- added support for iso8061 timezone ([5ac14f63](https://github.com/angular/angular.js/commit/5ac14f633a69f49973b5512780c6ec7752405967))
- **matchers.toHaveClass:**
- Correct reference to angular.mock.dump ([f701ce08](https://github.com/angular/angular.js/commit/f701ce08f9d63be05fc3b92f57ad473e1e749b2d))
- **ng-switch:**
- properly destroy child scopes ([2315d9b3](https://github.com/angular/angular.js/commit/2315d9b3610994b36c44e4a97fb1427d59471ce8))
- **ngDocSpec:**
- fix broken tests ([53b6f522](https://github.com/angular/angular.js/commit/53b6f522a56eea314cbd084816e08f24b2c7879f))
- **ngForm:**
- alias name||ngForm ([823adb23](https://github.com/angular/angular.js/commit/823adb231995e917bc060bfa49453e2a96bac2b6))
- **ngRepeat:**
- correct variable reference in error message ([935c1018](https://github.com/angular/angular.js/commit/935c1018da05dbf3124b2dd33619c4a3c82d7a2a))
- **ngView:**
- controller not published ([21e74c2d](https://github.com/angular/angular.js/commit/21e74c2d2e8e985b23711785287feb59965cbd90))
- **q:**
- resolve all of nothing to nothing ([ac75079e](https://github.com/angular/angular.js/commit/ac75079e2113949d5d64adbcf23d56f3cf295d41))
- **select:**
- multiselect failes to update view on selection insert ([6ecac8e7](https://github.com/angular/angular.js/commit/6ecac8e71a84792a434d21db2c245b3648c55f18))
## Features
- **$compile:**
- do not interpolate boolean attributes, rather evaluate them ([a08cbc02](https://github.com/angular/angular.js/commit/a08cbc02e78e789a66e9af771c410e8ad1646e25))
- **$controller:**
- support controller registration via $controllerProvider ([d54dfecb](https://github.com/angular/angular.js/commit/d54dfecb00fba41455536c5ddd55310592fdaf84))
- **$route:**
- when matching consider trailing slash as optional ([a4fe51da](https://github.com/angular/angular.js/commit/a4fe51da3ba0dc297ecd389e230d6664f250c9a6), closes [#784](https://github.com/angular/angular.js/issues/784))
- **assertArgFn:**
- should support array annotated fns ([4b8d9260](https://github.com/angular/angular.js/commit/4b8d926062eb4d4483555bdbdec4656f585ab40b))
- **http:**
- added params parameter ([73c85930](https://github.com/angular/angular.js/commit/73c8593077155a9f2e8ef42efd4c497eba0bef4f))
- **injector:**
- infer _foo_ as foo ([f13dd339](https://github.com/angular/angular.js/commit/f13dd3393dfb7a33565c9360342c193bc0bddcb6))
- **input.radio:**
- Allow value attribute to be interpolated ([ade6c452](https://github.com/angular/angular.js/commit/ade6c452753145c84884d17027a7865bf4b34b0c))
- **jqLite:**
- make injector() and scope() work with the document object ([5fdab52d](https://github.com/angular/angular.js/commit/5fdab52dd7c269f99839f4fa6b5854d9548269fa))
- add .controller() method ([6c5a05ad](https://github.com/angular/angular.js/commit/6c5a05ad49a1e083570c3dfe331403398f899dbe))
- **ngValue:**
- allow radio inputs to have non string values ([09e175f0](https://github.com/angular/angular.js/commit/09e175f02cca0f4a295fd0c9b980cd8f432e722b), closes [#816](https://github.com/angular/angular.js/issues/816))
- **scope:**
- broadcast $destroy event on scope destruction ([9b1aff90](https://github.com/angular/angular.js/commit/9b1aff905b638aa274a5fc8f88662df446d374bd))
- **scope.$eval:**
- Allow passing locals to the expression ([192ff61f](https://github.com/angular/angular.js/commit/192ff61f5d61899e667c6dbce4d3e6e399429d8b))
## Breaking Changes
- boolean attrs are evaluated rather than interpolated ([a08cbc02](https://github.com/angular/angular.js/commit/a08cbc02e78e789a66e9af771c410e8ad1646e25))
- ng-bind-attr directive removed ([55027132](https://github.com/angular/angular.js/commit/55027132f3d57e5dcf94683e6e6bd7b0aae0087d))
- any app that depends on this service and its fallback to Modernizr, please ([aaedefb9](https://github.com/angular/angular.js/commit/aaedefb92e6bec6626e173e5155072c91471596a))
Executable
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
grunt minify
gzip -c < build/angular.min.js > build/angular.min.js.gzip
ls -l build/angular.min.*
+6 -86
View File
@@ -1,91 +1,11 @@
@charset "UTF-8";
[ng\:cloak], .ng-cloak {
display: none;
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],
.ng-cloak, .x-ng-cloak,
.ng-hide {
display: none !important;
}
.ng-format-negative {
color: red;
}
.ng-exception {
border: 2px solid #FF0000;
font-family: "Courier New", Courier, monospace;
font-size: smaller;
white-space: pre;
}
.ng-validation-error {
border: 2px solid #FF0000;
}
/*****************
* TIP
*****************/
#ng-callout {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 13px;
font-weight: normal;
font-family: Verdana, Arial, Helvetica, sans-serif;
vertical-align: baseline;
background: transparent;
text-decoration: none;
}
#ng-callout .ng-arrow-left{
background-image: url("data:image/gif;base64,R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrSLoc/AG8FeUUIN+sGebWAnbKSJodqqlsOxJtqYooU9vvk+vcJIcTkg+QAAA7");
background-repeat: no-repeat;
background-position: left top;
position: absolute;
z-index:101;
left:-12px;
height:23px;
width:10px;
top:-3px;
}
#ng-callout .ng-arrow-right{
background-image: url("data:image/gif;base64,R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrCLTcoM29yN6k9socs91e5X3EyJloipYrO4ohTMqA0Fn2XVNswJe+H+SXAAA7");
background-repeat: no-repeat;
background-position: left top;
position: absolute;
z-index:101;
height:23px;
width:11px;
top:-2px;
}
#ng-callout {
position: absolute;
z-index:100;
border: 2px solid #CCCCCC;
background-color: #fff;
}
#ng-callout .ng-content{
padding:10px 10px 10px 10px;
color:#333333;
}
#ng-callout .ng-title{
background-color: #CCCCCC;
text-align: left;
padding-left: 8px;
padding-bottom: 5px;
padding-top: 2px;
font-weight:bold;
}
/*****************
* indicators
*****************/
.ng-input-indicator-wait {
background-image: url("data:image/png;base64,R0lGODlhEAAQAPQAAP///wAAAPDw8IqKiuDg4EZGRnp6egAAAFhYWCQkJKysrL6+vhQUFJycnAQEBDY2NmhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAkKAAAALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnAKM0KDV4EEEAQLiF18TAYNXDaSe3x6mjidN1s3IQAh+QQJCgAAACwAAAAAEAAQAAAFeCAgAgLZDGU5jgRECEUiCI+yioSDwDJyLKsXoHFQxBSHAoAAFBhqtMJg8DgQBgfrEsJAEAg4YhZIEiwgKtHiMBgtpg3wbUZXGO7kOb1MUKRFMysCChAoggJCIg0GC2aNe4gqQldfL4l/Ag1AXySJgn5LcoE3QXI3IQAh+QQJCgAAACwAAAAAEAAQAAAFdiAgAgLZNGU5joQhCEjxIssqEo8bC9BRjy9Ag7GILQ4QEoE0gBAEBcOpcBA0DoxSK/e8LRIHn+i1cK0IyKdg0VAoljYIg+GgnRrwVS/8IAkICyosBIQpBAMoKy9dImxPhS+GKkFrkX+TigtLlIyKXUF+NjagNiEAIfkECQoAAAAsAAAAABAAEAAABWwgIAICaRhlOY4EIgjH8R7LKhKHGwsMvb4AAy3WODBIBBKCsYA9TjuhDNDKEVSERezQEL0WrhXucRUQGuik7bFlngzqVW9LMl9XWvLdjFaJtDFqZ1cEZUB0dUgvL3dgP4WJZn4jkomWNpSTIyEAIfkECQoAAAAsAAAAABAAEAAABX4gIAICuSxlOY6CIgiD8RrEKgqGOwxwUrMlAoSwIzAGpJpgoSDAGifDY5kopBYDlEpAQBwevxfBtRIUGi8xwWkDNBCIwmC9Vq0aiQQDQuK+VgQPDXV9hCJjBwcFYU5pLwwHXQcMKSmNLQcIAExlbH8JBwttaX0ABAcNbWVbKyEAIfkECQoAAAAsAAAAABAAEAAABXkgIAICSRBlOY7CIghN8zbEKsKoIjdFzZaEgUBHKChMJtRwcWpAWoWnifm6ESAMhO8lQK0EEAV3rFopIBCEcGwDKAqPh4HUrY4ICHH1dSoTFgcHUiZjBhAJB2AHDykpKAwHAwdzf19KkASIPl9cDgcnDkdtNwiMJCshACH5BAkKAAAALAAAAAAQABAAAAV3ICACAkkQZTmOAiosiyAoxCq+KPxCNVsSMRgBsiClWrLTSWFoIQZHl6pleBh6suxKMIhlvzbAwkBWfFWrBQTxNLq2RG2yhSUkDs2b63AYDAoJXAcFRwADeAkJDX0AQCsEfAQMDAIPBz0rCgcxky0JRWE1AmwpKyEAIfkECQoAAAAsAAAAABAAEAAABXkgIAICKZzkqJ4nQZxLqZKv4NqNLKK2/Q4Ek4lFXChsg5ypJjs1II3gEDUSRInEGYAw6B6zM4JhrDAtEosVkLUtHA7RHaHAGJQEjsODcEg0FBAFVgkQJQ1pAwcDDw8KcFtSInwJAowCCA6RIwqZAgkPNgVpWndjdyohACH5BAkKAAAALAAAAAAQABAAAAV5ICACAimc5KieLEuUKvm2xAKLqDCfC2GaO9eL0LABWTiBYmA06W6kHgvCqEJiAIJiu3gcvgUsscHUERm+kaCxyxa+zRPk0SgJEgfIvbAdIAQLCAYlCj4DBw0IBQsMCjIqBAcPAooCBg9pKgsJLwUFOhCZKyQDA3YqIQAh+QQJCgAAACwAAAAAEAAQAAAFdSAgAgIpnOSonmxbqiThCrJKEHFbo8JxDDOZYFFb+A41E4H4OhkOipXwBElYITDAckFEOBgMQ3arkMkUBdxIUGZpEb7kaQBRlASPg0FQQHAbEEMGDSVEAA1QBhAED1E0NgwFAooCDWljaQIQCE5qMHcNhCkjIQAh+QQJCgAAACwAAAAAEAAQAAAFeSAgAgIpnOSoLgxxvqgKLEcCC65KEAByKK8cSpA4DAiHQ/DkKhGKh4ZCtCyZGo6F6iYYPAqFgYy02xkSaLEMV34tELyRYNEsCQyHlvWkGCzsPgMCEAY7Cg04Uk48LAsDhRA8MVQPEF0GAgqYYwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==");
background-position: right;
background-repeat: no-repeat;
ng\:form {
display: block;
}
+72
View File
@@ -0,0 +1,72 @@
describe("DocsNavigationCtrl", function() {
beforeEach(module('docsApp'));
var ctrl, $scope;
beforeEach(function() {
module(function($provide) {
$provide.value('docsPages', []);
$provide.factory('docsSearch', function() {
return function(q) {
return ['one','two','three'];
};
});
});
inject(function($controller, $rootScope, $location, docsSearch) {
$scope = $rootScope.$new();
ctrl = $controller('DocsNavigationCtrl', {
$scope : $scope,
$location : $location,
docsSearch : docsSearch
});
});
});
it("should search and return data from docsSearch", function() {
$scope.search('1234')
expect($scope.results.join(',')).toBe('one,two,three');
expect($scope.hasResults).toBe(true);
});
it("should avoid searching if the search term is too short", function() {
$scope.search('1')
expect($scope.results.length).toBe(0);
expect($scope.hasResults).toBe(false);
});
it("should set the columns classname based on the total grouped results", function() {
$scope.search('1234');
expect($scope.colClassName).toBe('cols-3');
$scope.search('1');
expect($scope.colClassName).toBe(null);
});
it("should hide and clear the results when called", function() {
$scope.hasResults = true;
$scope.results = ['one'];
$scope.colClassName = '...';
$scope.hideResults();
expect($scope.hasResults).toBe(false);
expect($scope.results.length).toBe(0);
expect($scope.colClassName).toBe(null);
});
it("should hide, clear and change the path of the page when submitted", inject(function($location) {
$scope.hasResults = true;
$scope.results = {
api : [
{url : '/home'}
],
tutorial : [
{url : '/tutorial'}
]
};
$scope.submit();
expect($location.path()).toBe('/home');
expect($scope.results.length).toBe(0);
expect($scope.hasResults).toBe(false);
}));
});
+194
View File
@@ -0,0 +1,194 @@
describe('Docs Annotations', function() {
beforeEach(module('docsApp'));
var body;
beforeEach(function() {
body = angular.element(document.body);
body.html('');
});
describe('popover directive', function() {
var $scope, element;
beforeEach(inject(function($rootScope, $compile) {
$scope = $rootScope.$new();
element = angular.element(
'<div style="margin:200px;" data-title="title_text" data-content="content_text" popover></div>'
);
element.attr('id','idx');
body.append(element);
$compile(element)($scope);
$scope.$apply();
}));
it('should be hidden by default', inject(function(popoverElement) {
expect(popoverElement.visible()).toBe(false);
}));
it('should capture the click event and set the title and content and position the tip', inject(function(popoverElement) {
element.triggerHandler('click');
expect(popoverElement.isSituatedAt(element)).toBe(true);
expect(popoverElement.visible()).toBe(true);
expect(popoverElement.title()).toBe('title_text');
expect(popoverElement.content()).toContain('content_text');
expect(popoverElement.besideElement.attr('id')).toBe('idx');
}));
it('should hide and clear the title and content if the same element is clicked again', inject(function(popoverElement) {
//show the element
element.triggerHandler('click');
expect(popoverElement.isSituatedAt(element)).toBe(true);
//hide the element
element.triggerHandler('click');
expect(popoverElement.isSituatedAt(element)).toBe(false);
expect(popoverElement.visible()).toBe(false);
expect(popoverElement.title()).toBe('');
expect(popoverElement.content()).toBe('');
}));
it('should parse markdown content', inject(function(popoverElement, $compile) {
element = angular.element(
'<div style="margin:200px;" data-title="#title_text" data-content="#heading" popover></div>'
);
body.append(element);
$compile(element)($scope);
$scope.$apply();
element.triggerHandler('click');
expect(popoverElement.title()).toBe('#title_text');
expect(popoverElement.content()).toBe('<h1>heading</h1>\n');
}));
});
describe('foldout directive', function() {
var $scope, parent, element, url, window;
beforeEach(function() {
module(function($provide, $animateProvider) {
$provide.value('$window', window = angular.mock.createMockWindow());
$animateProvider.register('.foldout', function($timeout) {
return {
enter : function(element, done) {
$timeout(done, 1000);
},
removeClass : function(element, className, done) {
$timeout(done, 500);
},
addClass : function(element, className, done) {
$timeout(done, 200);
}
}
});
});
inject(function($rootScope, $compile, $templateCache, $rootElement, $animate) {
$animate.enabled(true);
url = '/page.html';
$scope = $rootScope.$new();
parent = angular.element('<div class="parent"></div>');
//we're injecting the element to the $rootElement since the changes in
//$animate only detect and perform animations if the root element has
//animations enabled. If the element is not apart of the DOM
//then animations are skipped.
element = angular.element('<div data-url="' + url + '" class="foldout" foldout></div>');
parent.append(element);
$rootElement.append(parent);
body.append($rootElement);
$compile(parent)($scope);
$scope.$apply();
});
});
it('should inform that it is loading', inject(function($httpBackend) {
$httpBackend.expect('GET', url).respond('hello');
element.triggerHandler('click');
var kids = body.children();
var foldout = angular.element(kids[kids.length-1]);
expect(foldout.html()).toContain('loading');
}));
it('should download a foldout HTML page and animate the contents', inject(function($httpBackend, $timeout) {
$httpBackend.expect('GET', url).respond('hello');
element.triggerHandler('click');
$httpBackend.flush();
$timeout.flushNext(0);
$timeout.flushNext(1);
$timeout.flushNext(0);
$timeout.flushNext(1000);
var kids = body.children();
var foldout = angular.element(kids[kids.length-1]);
expect(foldout.text()).toContain('hello');
}));
it('should hide then show when clicked again', inject(function($httpBackend, $timeout) {
$httpBackend.expect('GET', url).respond('hello');
//enter
element.triggerHandler('click');
$httpBackend.flush();
$timeout.flushNext(0);
$timeout.flushNext(1);
$timeout.flushNext(0);
$timeout.flushNext(1000);
//hide
element.triggerHandler('click');
$timeout.flushNext(1);
$timeout.flushNext(0);
$timeout.flushNext(200);
$timeout.flushNext(0);
//show
element.triggerHandler('click');
$timeout.flushNext(1);
$timeout.flushNext(0);
$timeout.flushNext(500);
$timeout.flushNext(0);
}));
});
describe('DocsController fold', function() {
var window, $scope, ctrl;
beforeEach(function() {
module(function($provide, $animateProvider) {
$provide.value('$window', window = angular.mock.createMockWindow());
});
inject(function($rootScope, $controller, $location, $cookies, sections) {
$scope = $rootScope.$new();
ctrl = $controller('DocsController',{
$scope : $scope,
$location : $location,
$window : window,
$cookies : $cookies,
sections : sections
});
});
});
it('should download and reveal the foldover container', inject(function($compile, $httpBackend) {
var url = '/page.html';
var fullUrl = '/notes/' + url;
$httpBackend.expect('GET', fullUrl).respond('hello');
var element = angular.element('<div ng-include="docs_fold"></div>');
$compile(element)($scope);
$scope.$apply();
$scope.fold(url);
$httpBackend.flush();
}));
});
});
+157
View File
@@ -0,0 +1,157 @@
'use strict';
describe('bootstrap', function() {
var $compile, $rootScope, element;
function clickTab(element, index) {
browserTrigger(element.children().eq(0).children().eq(index));
}
beforeEach(module('bootstrap'));
beforeEach(inject(function(_$compile_, _$rootScope_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
}));
beforeEach(function(){
function findTab(element, index) {
return _jQuery(element[0]).find('> .nav-tabs > li').eq(index);
}
function findTabPane(element, index) {
return _jQuery(element[0]).find('> .tab-content > .tab-pane').eq(index);
}
this.addMatchers({
toHaveTab: function(index, title) {
var tab = findTab(element, index);
this.message = function() {
if (tab.length) {
return 'Expect tab index ' + index + ' to be ' + toJson(title) + ' but was ' + toJson(tab.text());
} else {
return 'Expect tab index ' + index + ' to be ' + toJson(title) + ' but there are only ' +
element.children().length + ' tabs.';
}
};
return tab.length && tab.text() == title;
},
toHaveTabPane: function(index, title) {
var tabPane = findTabPane(element, index);
this.message = function() {
if (tabPane.length) {
return 'Expect tab pane index ' + index + ' to be ' + toJson(title) + ' but was ' + toJson(tabPane.text());
} else {
return 'Expect tab pane index ' + index + ' to be ' + toJson(title) + ' but there are only ' +
element.children().length + 'tab panes.';
}
};
return tabPane.length && tabPane.text() == title;
},
toHaveSelected: function(index) {
var tab = findTab(element, index);
var tabPane = findTabPane(element, index);
this.message = function() {
return 'Expect tab index ' + index + ' to be selected\n' +
' TAB: ' + angular.mock.dump(tab) + '\n' +
'TAB-PANE: ' + angular.mock.dump(tabPane);
};
return tabPane.hasClass('active') && tab.hasClass('active');
}
});
});
afterEach(function() {
dealoc(element);
});
describe('tabbable', function() {
it('should create the right structure', function() {
element = $compile(
'<div class="tabbable">' +
'<div class="tab-pane" title="first">tab1</div>' +
'<div class="tab-pane" title="second">tab2</div>' +
'</div>')($rootScope);
$rootScope.$apply();
expect(element).toHaveTab(0, 'first');
expect(element).toHaveTab(1, 'second');
expect(element).toHaveTabPane(0, 'tab1');
expect(element).toHaveTabPane(1, 'tab2');
expect(element).toHaveSelected(0);
});
it('should respond to tab click', function(){
element = $compile(
'<div class="tabbable">' +
'<div class="tab-pane" title="first">tab1</div>' +
'<div class="tab-pane" title="second">tab2</div>' +
'</div>')($rootScope);
expect(element).toHaveSelected(0);
clickTab(element, 1);
expect(element).toHaveSelected(1);
});
it('should select the first tab in repeater', function() {
element = $compile(
'<div class="tabbable">' +
'<div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value="tab-{{id}}">' +
'Tab content {{id}}!' +
'</div>' +
'</div>')($rootScope);
$rootScope.$apply();
expect(element).toHaveSelected(0);
});
describe('ngModel', function() {
it('should bind to model', function() {
$rootScope.tab = 'B';
element = $compile(
'<div class="tabbable" ng-model="tab">' +
'<div class="tab-pane" title="first" value="A">tab1</div>' +
'<div class="tab-pane" title="second" value="B">tab2</div>' +
'</div>')($rootScope);
$rootScope.$apply();
expect(element).toHaveSelected(1);
$rootScope.tab = 'A';
$rootScope.$apply();
expect(element).toHaveSelected(0);
clickTab(element, 1);
expect($rootScope.tab).toEqual('B');
expect(element).toHaveSelected(1);
});
it('should not overwrite the model', function() {
$rootScope.tab = 'tab-2';
element = $compile(
'<div class="tabbable" ng-model="tab">' +
'<div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value="tab-{{id}}">' +
'Tab content {{id}}!' +
'</div>' +
'</div>')($rootScope);
$rootScope.$apply();
expect(element).toHaveSelected(1);
});
});
});
});
+91
View File
@@ -0,0 +1,91 @@
<!doctype html>
<html>
<head>
<script src="../../src/angular-bootstrap.js"></script>
<script type="text/javascript">
$script('src/bootstrap/google-prettify/prettify', 'prettify');
$script.ready('angular', function() {
$script(['src/bootstrap/bootstrap-prettify', 'src/bootstrap/bootstrap'], 'myCode');
angular.module('myApp', []).run(function($rootScope){ $rootScope.text = 'WORKS!' });
});
$script.ready(['myCode', 'prettify'], function() {
angular.bootstrap(document, ['bootstrapPrettify', 'bootstrap']);
});
</script>
<link rel="stylesheet" href="../../src/bootstrap/google-prettify/prettify.css" type="text/css">
<link rel="stylesheet" href="../../src/bootstrap/css/bootstrap.css" type="text/css">
</head>
<body>
<div class="container">
<div class="row">
<div class="span12">
<h1>AngularJS is {{'working'}}</h1>
<h2>Directive: <code>prettify</code></h2>
<pre class="prettyprint linenums">
&lt;p&gt;Sample text here...&lt;/p&gt;
</pre>
<h2>Directive: <code>ng-set-text</code></h2>
<pre class="prettyprint linenums" ng-set-text="hello.html"></pre>
<script type="text/html" id="hello.html">
<h1>Hello World!</h1>
</script>
<h2>Directive: <code>ng-html-wrap</code></h2>
<pre class="prettyprint linenums" ng-set-text="hello.html" ng-html-wrap="angular.js angular-resource.js myApp abc.js abc.css"></pre>
<h2>Directive <code>ng-embed-app</code></h2>
<div ng-embed-app="myApp">{{text}}</div>
<h1>Bootstrap</h1>
<h2>Directive <code>drop-down-toggle</code></h2>
<div class="btn btn-primary dropdown">
<a href="#ABC" class="dropdown-toggle">
Account
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>One</li>
<li>Two</li>
</ul>
</div>
<h2 ng-init="state = 'tab-2' ">Directive <code>tabbable</code></h2>
state = {{state}}
<div class="tabbable" ng-model="state">
<div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value='tab-{{id}}'>
Tab content {{id}}!
</div>
</div>
<hr/>
<div class="tabbable" ng-model="state">
<div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value='tab-{{id}}'>
Tab content {{id}}!
</div>
</div>
<hr/>
<div class="tabbable">
<div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value='tab-{{id}}'>
Tab content {{id}}!
</div>
</div>
</div>
</div>
</div>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</body>
</html>
+59
View File
@@ -0,0 +1,59 @@
describe("docsSearch", function() {
beforeEach(module('docsApp'));
var interceptedLunrResults;
beforeEach(function() {
interceptedLunrResults = [];
});
beforeEach(function() {
module(function($provide) {
var results = [];
results[0] = { section: 'tutorial', shortName: 'item one', keywords: 'item, one, 1' };
results[1] = { section: 'tutorial', shortName: 'item man', keywords: 'item, man' };
results[2] = { section: 'api', shortName: 'item other', keywords: 'item, other' };
results[3] = { section: 'cookbook', shortName: 'item cookbook', keywords: 'item, other' };
results[4] = { section: 'api', shortName: 'ngRepeat', keywords: 'item, other' };
$provide.value('NG_PAGES', results);
$provide.factory('lunrSearch', function() {
return function() {
return {
store : function(value) {
interceptedLunrResults.push(value);
},
search : function(q) {
var data = [];
angular.forEach(results, function(res, i) {
data.push({ ref : i });
});
return data;
}
}
};
});
});
});
it("should lookup and organize values properly", inject(function(docsSearch) {
var items = docsSearch('item');
expect(items['api'].length).toBe(2);
}));
it("should place cookbook items in the tutorial", inject(function(docsSearch) {
var items = docsSearch('item');
expect(items['tutorial'].length).toBe(3);
}));
it("should return all results without a search", inject(function(docsSearch) {
var items = docsSearch();
expect(items['tutorial'].length).toBe(3);
expect(items['api'].length).toBe(2);
}));
it("should store values with and without a ng prefix", inject(function(docsSearch) {
expect(interceptedLunrResults[4].title).toBe('ngRepeat repeat');
}));
});
+76
View File
@@ -0,0 +1,76 @@
describe("errorDisplay", function () {
var $location, compileHTML;
beforeEach(module('docsApp'));
beforeEach(inject(function ($injector) {
var $rootScope = $injector.get('$rootScope'),
$compile = $injector.get('$compile');
$location = $injector.get('$location');
compileHTML = function (code) {
var elm = angular.element(code);
$compile(elm)($rootScope);
$rootScope.$digest();
return elm;
};
this.addMatchers({
toInterpolateTo: function (expected) {
// Given a compiled DOM node with a minerr-display attribute,
// assert that its interpolated string matches the expected text.
return this.actual.text() === expected;
}
});
}));
it('should interpolate a template with no parameters', function () {
var elm;
spyOn($location, 'search').andReturn({});
elm = compileHTML('<div error-display="This is a test"></div>');
expect(elm).toInterpolateTo('This is a test');
});
it('should interpolate a template with no parameters when search parameters are present', function () {
var elm;
spyOn($location, 'search').andReturn({ p0: 'foobaz' });
elm = compileHTML('<div error-display="This is a test"></div>');
expect(elm).toInterpolateTo('This is a test');
});
it('should correctly interpolate search parameters', function () {
var elm;
spyOn($location, 'search').andReturn({ p0: '42' });
elm = compileHTML('<div error-display="The answer is {0}"></div>');
expect(elm).toInterpolateTo('The answer is 42');
});
it('should interpolate parameters in the specified order', function () {
var elm;
spyOn($location, 'search').andReturn({ p0: 'second', p1: 'first' });
elm = compileHTML('<div error-display="{1} {0}"></div>');
expect(elm).toInterpolateTo('first second');
});
it('should preserve interpolation markers when fewer arguments than needed are provided', function () {
var elm;
spyOn($location, 'search').andReturn({ p0: 'Fooooo' });
elm = compileHTML('<div error-display="This {0} is {1} on {2}"></div>');
expect(elm).toInterpolateTo('This Fooooo is {1} on {2}');
});
it('should correctly handle the empty string as an interpolation parameter', function () {
var elm;
spyOn($location, 'search').andReturn({ p0: 'test', p1: '' });
elm = compileHTML('<div error-display="This {0} is a {1}"></div>');
expect(elm).toInterpolateTo('This test is a ');
});
});
+50
View File
@@ -0,0 +1,50 @@
describe('Docs Syntax', function() {
beforeEach(module('bootstrap'));
describe('syntax', function() {
var id, element, document;
beforeEach(inject(function($compile, $rootScope, $document) {
document = $document[0];
//create the HTML elements missing in IE8 for this directive
document.createElement('nav');
element = angular.element(
'<div>' +
'<pre syntax ' +
'syntax-github="gh-url" ' +
'syntax-plunkr="pl-url" ' +
'syntax-fiddle="jf-url">' +
'</pre>' +
'</div>'
);
$compile(element)($rootScope);
$rootScope.$digest();
element = element[0];
document.body.appendChild(element);
}));
it("should properly prepare a github link in the page", function() {
var github = element.querySelector('.syntax-github');
expect(github.innerHTML).toMatch(/View on Github/i);
expect(github.getAttribute('href')).toBe('gh-url');
});
it("should properly prepare a plunkr link in the page", function() {
var plunkr = element.querySelector('.syntax-plunkr');
expect(plunkr.innerHTML).toMatch(/View on Plunkr/i);
expect(plunkr.getAttribute('href')).toBe('pl-url');
});
it("should properly prepare a jsfiddle link in the page", function() {
var jsfiddle = element.querySelector('.syntax-jsfiddle');
expect(jsfiddle.innerHTML).toMatch(/View on JSFiddle/i);
expect(jsfiddle.getAttribute('href')).toBe('jf-url');
});
});
});
+125
View File
@@ -0,0 +1,125 @@
describe('DocsApp', function() {
beforeEach(module('docsApp'));
describe('DocsVersionsCtrl', function() {
var $scope, ctrl, window, version = '9.8.7';
beforeEach(function() {
module(function($provide) {
$provide.value('NG_VERSIONS',[
'1.0.0',
'1.0.1',
'1.0.2',
'1.0.3',
'1.0.4',
'1.0.5',
'1.0.6',
'1.1.0',
'1.1.1',
'1.1.2',
'1.1.3',
'1.1.4',
'2.1.3'
]);
$provide.value('$window', window = angular.mock.createMockWindow());
});
inject(function($controller, $rootScope) {
$scope = $rootScope.$new();
$scope.version = version;
ctrl = $controller('DocsVersionsCtrl',{
$scope : $scope,
$window : window
});
});
});
it('should have the correct version of angular', function() {
expect(version).toBe($scope.version);
});
it('should order versions in decending order', function() {
expect($scope.versions.length).toBeGreaterThan(0);
var one = $scope.versions[0].version;
var two = $scope.versions[1].version;
expect(one).toBeGreaterThan(two);
});
it('should list unstable versions at the top of the list', function() {
expect($scope.versions[0].stable).toBe(false);
});
it('should list all items below the last stable as stable regardless of version number', function() {
var limit = $scope.versions.length - 1,
lastUnstableIndex = 0;
while(lastUnstableIndex <= limit) {
if($scope.versions[lastUnstableIndex++].stable) break;
}
for(var i=lastUnstableIndex;i<=limit;i++) {
expect($scope.versions[i].stable).toBe(true);
}
});
describe('changing the URL', function() {
it('should not support the old < 1.0 docs pages', function() {
window.location = 'old';
$scope.versions.unshift({
stable : true,
version : '0.9.10'
});
$scope.jumpToDocsVersion('0.9.10');
expect(window.location).toBe('old');
$scope.versions.unshift({
stable : true,
version : '0.10.1'
});
$scope.jumpToDocsVersion('0.10.1');
expect(window.location).toBe('old');
$scope.jumpToDocsVersion('2.1.3');
expect(window.location).toBe('http://code.angularjs.org/2.1.3/docs');
});
it('should jump to the older versions of current docs for version >= 1.0.2', function() {
$scope.jumpToDocsVersion('1.0.1');
expect(window.location).toBe('http://code.angularjs.org/1.0.1/docs-1.0.1');
$scope.jumpToDocsVersion('1.0.2');
expect(window.location).toBe('http://code.angularjs.org/1.0.2/docs');
$scope.jumpToDocsVersion('1.1.2');
expect(window.location).toBe('http://code.angularjs.org/1.1.2/docs');
});
it('should use the current docs.angularjs.org page when the selected version is the last stable version', function() {
$scope.versions = [{
stable : true,
title : 'test',
version : '1.1.1'
}];
$scope.jumpToDocsVersion('1.1.1');
expect(window.location).toBe('http://docs.angularjs.org');
$scope.versions.unshift({
stable : true,
title : 'test2',
version : '1.2.1'
});
$scope.jumpToDocsVersion('1.1.1');
expect(window.location).toBe('http://code.angularjs.org/1.1.1/docs');
$scope.jumpToDocsVersion('1.2.1');
expect(window.location).toBe('http://docs.angularjs.org');
});
});
});
});
+227
View File
@@ -0,0 +1,227 @@
/*!
* $script.js Async loader & dependency manager
* https://github.com/ded/script.js
* (c) Dustin Diaz, Jacob Thornton 2011
* License: MIT
*/
(function (name, definition, context) {
if (typeof context['module'] != 'undefined' && context['module']['exports']) context['module']['exports'] = definition()
else if (typeof context['define'] != 'undefined' && context['define'] == 'function' && context['define']['amd']) define(name, definition)
else context[name] = definition()
})('$script', function () {
var doc = document
, head = doc.getElementsByTagName('head')[0]
, validBase = /^https?:\/\//
, list = {}, ids = {}, delay = {}, scriptpath
, scripts = {}, s = 'string', f = false
, push = 'push', domContentLoaded = 'DOMContentLoaded', readyState = 'readyState'
, addEventListener = 'addEventListener', onreadystatechange = 'onreadystatechange'
function every(ar, fn) {
for (var i = 0, j = ar.length; i < j; ++i) if (!fn(ar[i])) return f
return 1
}
function each(ar, fn) {
every(ar, function(el) {
return !fn(el)
})
}
if (!doc[readyState] && doc[addEventListener]) {
doc[addEventListener](domContentLoaded, function fn() {
doc.removeEventListener(domContentLoaded, fn, f)
doc[readyState] = 'complete'
}, f)
doc[readyState] = 'loading'
}
function $script(paths, idOrDone, optDone) {
paths = paths[push] ? paths : [paths]
var idOrDoneIsDone = idOrDone && idOrDone.call
, done = idOrDoneIsDone ? idOrDone : optDone
, id = idOrDoneIsDone ? paths.join('') : idOrDone
, queue = paths.length
function loopFn(item) {
return item.call ? item() : list[item]
}
function callback() {
if (!--queue) {
list[id] = 1
done && done()
for (var dset in delay) {
every(dset.split('|'), loopFn) && !each(delay[dset], loopFn) && (delay[dset] = [])
}
}
}
setTimeout(function () {
each(paths, function (path) {
if (scripts[path]) {
id && (ids[id] = 1)
return scripts[path] == 2 && callback()
}
scripts[path] = 1
id && (ids[id] = 1)
create(!validBase.test(path) && scriptpath ? scriptpath + path + '.js' : path, callback)
})
}, 0)
return $script
}
function create(path, fn) {
var el = doc.createElement('script')
, loaded = f
el.onload = el.onerror = el[onreadystatechange] = function () {
if ((el[readyState] && !(/^c|loade/.test(el[readyState]))) || loaded) return;
el.onload = el[onreadystatechange] = null
loaded = 1
scripts[path] = 2
fn()
}
el.async = 1
el.src = path
head.insertBefore(el, head.firstChild)
}
$script.get = create
$script.order = function (scripts, id, done) {
(function callback(s) {
s = scripts.shift()
if (!scripts.length) $script(s, id, done)
else $script(s, callback)
}())
}
$script.path = function (p) {
scriptpath = p
}
$script.ready = function (deps, ready, req) {
deps = deps[push] ? deps : [deps]
var missing = [];
!each(deps, function (dep) {
list[dep] || missing[push](dep);
}) && every(deps, function (dep) {return list[dep]}) ?
ready() : !function (key) {
delay[key] = delay[key] || []
delay[key][push](ready)
req && req(missing)
}(deps.join('|'))
return $script
}
return $script
}, this);
/**
* @license AngularJS
* (c) 2010-2012 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, document) {
var filename = /^(.*\/)angular-bootstrap.js(#.*)?$/,
scripts = document.getElementsByTagName("SCRIPT"),
serverPath,
match,
globalVars = {},
IGNORE = {
innerHeight: true, innerWidth: true,
onkeyup: true, onkeydown: true, onresize: true,
event: true, frames: true, external: true,
sessionStorage: true, clipboardData: true, localStorage: true};
for(var j = 0; j < scripts.length; j++) {
match = (scripts[j].src || "").match(filename);
if (match) {
serverPath = match[1];
}
}
document.write('<link rel="stylesheet" type="text/css" href="' + serverPath + '../css/angular.css"/>');
$script.path(serverPath+'../');
$script('angularFiles', function() {
var index = 0,
scripts = angularFiles.angularSrc;
try { delete window.angularFiles; } catch(e) { window.angularFiles = undefined; }
// initialize the window property cache
for (var prop in window) {
if (IGNORE[prop] || prop.match(/^moz[A-Z]/)) { //skip special variables which keep on changing
continue;
}
try {
globalVars[key(prop)] = window[prop];
} catch(e) {} //ignore properties that throw exception when accessed (common in FF)
}
(function next() {
if (index < scripts.length) {
var file = scripts[index++],
last = index == scripts.length,
name = last ? 'angular' : file;
$script(file.replace(/\.js$/, ''), name, function() {
angularClobberTest(file);
next();
});
} else {
// empty the cache to prevent mem leaks
globalVars = {};
bindJQuery();
publishExternalAPI(window.angular);
angularInit(document, angular.bootstrap);
}
})();
});
function key(prop) {
return "ng-clobber_" + prop;
}
function angularClobberTest(file) {
var varKey, prop,
clobbered = {};
for (prop in window) {
varKey = key(prop);
if (IGNORE[prop] || prop.match(/^moz[A-Z]/)) { //skip special variables which keep on changing
continue;
} else if (!globalVars.hasOwnProperty(varKey)) {
//console.log('new global variable found: ', prop);
try {
globalVars[varKey] = window[prop];
} catch(e) {} //ignore properties that throw exception when accessed (common in FF)
} else if (globalVars[varKey] !== window[prop] && !isActuallyNaN(window[prop]) && prop != 'jqLite') {
clobbered[prop] = true;
console.error("Global variable clobbered by script " + file + "! Variable name: " + prop);
globalVars[varKey] = window[prop];
}
}
for (varKey in globalVars) {
prop = varKey.substr(11);
if (prop === 'event' || prop.match(/^moz[A-Z]/)) { //skip special variables which keep on changing
continue;
}
if (!clobbered[prop] &&
prop != 'event' &&
prop != 'jqLite' &&
!isActuallyNaN(globalVars[varKey]) &&
globalVars[varKey] !== window[prop]) {
delete globalVars[varKey];
console.warn("Global variable unexpectedly deleted in script " + file + "! " +
"Variable name: " + prop);
}
}
function isActuallyNaN(val) {
return (typeof val === 'number') && isNaN(val);
}
}
})(window, document);
+305
View File
@@ -0,0 +1,305 @@
'use strict';
var directive = {};
var service = { value: {} };
var DEPENDENCIES = {
'angular.js': 'http://code.angularjs.org/' + angular.version.full + '/angular.min.js',
'angular-resource.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-resource.min.js',
'angular-route.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-route.min.js',
'angular-animate.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-animate.min.js',
'angular-sanitize.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-sanitize.min.js',
'angular-cookies.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-cookies.min.js'
};
function escape(text) {
return text.
replace(/\&/g, '&amp;').
replace(/\</g, '&lt;').
replace(/\>/g, '&gt;').
replace(/"/g, '&quot;');
}
/**
* http://stackoverflow.com/questions/451486/pre-tag-loses-line-breaks-when-setting-innerhtml-in-ie
* http://stackoverflow.com/questions/195363/inserting-a-newline-into-a-pre-tag-ie-javascript
*/
function setHtmlIe8SafeWay(element, html) {
var newElement = angular.element('<pre>' + html + '</pre>');
element.html('');
element.append(newElement.contents());
return element;
}
directive.jsFiddle = function(getEmbeddedTemplate, escape, script) {
return {
terminal: true,
link: function(scope, element, attr) {
var name = '',
stylesheet = '<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">\n',
fields = {
html: '',
css: '',
js: ''
};
angular.forEach(attr.jsFiddle.split(' '), function(file, index) {
var fileType = file.split('.')[1];
if (fileType == 'html') {
if (index == 0) {
fields[fileType] +=
'<div ng-app' + (attr.module ? '="' + attr.module + '"' : '') + '>\n' +
getEmbeddedTemplate(file, 2);
} else {
fields[fileType] += '\n\n\n <!-- CACHE FILE: ' + file + ' -->\n' +
' <script type="text/ng-template" id="' + file + '">\n' +
getEmbeddedTemplate(file, 4) +
' </script>\n';
}
} else {
fields[fileType] += getEmbeddedTemplate(file) + '\n';
}
});
fields.html += '</div>\n';
setHtmlIe8SafeWay(element,
'<form class="jsfiddle" method="post" action="http://jsfiddle.net/api/post/library/pure/" target="_blank">' +
hiddenField('title', 'AngularJS Example: ' + name) +
hiddenField('css', '</style> <!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ --> \n' +
stylesheet +
script.angular +
(attr.resource ? script.resource : '') +
'<style>\n' +
fields.css) +
hiddenField('html', fields.html) +
hiddenField('js', fields.js) +
'<button class="btn btn-primary"><i class="icon-white icon-pencil"></i> Edit Me</button>' +
'</form>');
function hiddenField(name, value) {
return '<input type="hidden" name="' + name + '" value="' + escape(value) + '">';
}
}
}
};
directive.code = function() {
return {restrict: 'E', terminal: true};
};
directive.prettyprint = ['reindentCode', function(reindentCode) {
return {
restrict: 'C',
compile: function(element) {
var html = element.html();
//ensure that angular won't compile {{ curly }} values
html = html.replace(/\{\{/g, '<span>{{</span>')
.replace(/\}\}/g, '<span>}}</span>');
element.html(window.prettyPrintOne(reindentCode(html), undefined, true));
}
};
}];
directive.ngSetText = ['getEmbeddedTemplate', function(getEmbeddedTemplate) {
return {
restrict: 'CA',
priority: 10,
compile: function(element, attr) {
setHtmlIe8SafeWay(element, escape(getEmbeddedTemplate(attr.ngSetText)));
}
}
}]
directive.ngHtmlWrap = ['reindentCode', 'templateMerge', function(reindentCode, templateMerge) {
return {
compile: function(element, attr) {
var properties = {
head: '',
module: '',
body: element.text()
},
html = "<!doctype html>\n<html ng-app{{module}}>\n <head>\n{{head:4}} </head>\n <body>\n{{body:4}} </body>\n</html>";
angular.forEach((attr.ngHtmlWrap || '').split(' '), function(dep) {
if (!dep) return;
dep = DEPENDENCIES[dep] || dep;
var ext = dep.split(/\./).pop();
if (ext == 'css') {
properties.head += '<link rel="stylesheet" href="' + dep + '" type="text/css">\n';
} else if(ext == 'js') {
properties.head += '<script src="' + dep + '"></script>\n';
} else {
properties.module = '="' + dep + '"';
}
});
setHtmlIe8SafeWay(element, escape(templateMerge(html, properties)));
}
}
}];
directive.ngSetHtml = ['getEmbeddedTemplate', function(getEmbeddedTemplate) {
return {
restrict: 'CA',
priority: 10,
compile: function(element, attr) {
setHtmlIe8SafeWay(element, getEmbeddedTemplate(attr.ngSetHtml));
}
}
}];
directive.ngEvalJavascript = ['getEmbeddedTemplate', function(getEmbeddedTemplate) {
return {
compile: function (element, attr) {
var script = getEmbeddedTemplate(attr.ngEvalJavascript);
try {
if (window.execScript) { // IE
window.execScript(script || '""'); // IE complains when evaling empty string
} else {
window.eval(script);
}
} catch (e) {
if (window.console) {
window.console.log(script, '\n', e);
} else {
window.alert(e);
}
}
}
};
}];
directive.ngEmbedApp = ['$templateCache', '$browser', '$rootScope', '$location', '$sniffer', '$animate',
function($templateCache, $browser, docsRootScope, $location, $sniffer, $animate) {
return {
terminal: true,
link: function(scope, element, attrs) {
var modules = ['ngAnimate'],
embedRootScope,
deregisterEmbedRootScope;
modules.push(['$provide', function($provide) {
$provide.value('$animate', $animate);
$provide.value('$templateCache', $templateCache);
$provide.value('$anchorScroll', angular.noop);
$provide.value('$browser', $browser);
$provide.value('$sniffer', $sniffer);
$provide.provider('$location', function() {
this.$get = ['$rootScope', function($rootScope) {
docsRootScope.$on('$locationChangeSuccess', function(event, oldUrl, newUrl) {
$rootScope.$broadcast('$locationChangeSuccess', oldUrl, newUrl);
});
return $location;
}];
this.html5Mode = angular.noop;
});
$provide.decorator('$timeout', ['$rootScope', '$delegate', function($rootScope, $delegate) {
return angular.extend(function(fn, delay) {
if (delay && delay > 50) {
return setTimeout(function() {
$rootScope.$apply(fn);
}, delay);
} else {
return $delegate.apply(this, arguments);
}
}, $delegate);
}]);
$provide.decorator('$rootScope', ['$delegate', function($delegate) {
embedRootScope = $delegate;
deregisterEmbedRootScope = docsRootScope.$watch(function embedRootScopeDigestWatch() {
embedRootScope.$digest();
});
return embedRootScope;
}]);
}]);
if (attrs.ngEmbedApp) modules.push(attrs.ngEmbedApp);
element.on('click', function(event) {
if (event.target.attributes.getNamedItem('ng-click')) {
event.preventDefault();
}
});
element.bind('$destroy', function() {
deregisterEmbedRootScope();
embedRootScope.$destroy();
});
element.data('$injector', null);
angular.bootstrap(element, modules);
}
};
}];
service.reindentCode = function() {
return function (text, spaces) {
if (!text) return text;
var lines = text.split(/\r?\n/);
var prefix = ' '.substr(0, spaces || 0);
var i;
// remove any leading blank lines
while (lines.length && lines[0].match(/^\s*$/)) lines.shift();
// remove any trailing blank lines
while (lines.length && lines[lines.length - 1].match(/^\s*$/)) lines.pop();
var minIndent = 999;
for (i = 0; i < lines.length; i++) {
var line = lines[0];
var reindentCode = line.match(/^\s*/)[0];
if (reindentCode !== line && reindentCode.length < minIndent) {
minIndent = reindentCode.length;
}
}
for (i = 0; i < lines.length; i++) {
lines[i] = prefix + lines[i].substring(minIndent);
}
lines.push('');
return lines.join('\n');
}
};
service.templateMerge = ['reindentCode', function(indentCode) {
return function(template, properties) {
return template.replace(/\{\{(\w+)(?:\:(\d+))?\}\}/g, function(_, key, indent) {
var value = properties[key];
if (indent) {
value = indentCode(value, indent);
}
return value == undefined ? '' : value;
});
};
}];
service.getEmbeddedTemplate = ['reindentCode', function(reindentCode) {
return function (id) {
var element = document.getElementById(id);
if (!element) {
return null;
}
return reindentCode(angular.element(element).html(), 0);
}
}];
angular.module('bootstrapPrettify', []).directive(directive).factory(service);
+390
View File
@@ -0,0 +1,390 @@
'use strict';
var directive = {};
directive.dropdownToggle =
['$document', '$location', '$window',
function ($document, $location, $window) {
var openElement = null, close;
return {
restrict: 'C',
link: function(scope, element, attrs) {
scope.$watch(function dropdownTogglePathWatch(){return $location.path();}, function dropdownTogglePathWatchAction() {
close && close();
});
element.parent().on('click', function(event) {
close && close();
});
element.on('click', function(event) {
event.preventDefault();
event.stopPropagation();
var iWasOpen = false;
if (openElement) {
iWasOpen = openElement === element;
close();
}
if (!iWasOpen){
element.parent().addClass('open');
openElement = element;
close = function (event) {
event && event.preventDefault();
event && event.stopPropagation();
$document.off('click', close);
element.parent().removeClass('open');
close = null;
openElement = null;
}
$document.on('click', close);
}
});
}
};
}];
directive.syntax = function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
function makeLink(type, text, link, icon) {
return '<a href="' + link + '" class="btn syntax-' + type + '" target="_blank" rel="nofollow">' +
'<span class="' + icon + '"></span> ' + text +
'</a>';
};
var html = '';
var types = {
'github' : {
text : 'View on Github',
key : 'syntaxGithub',
icon : 'icon-github'
},
'plunkr' : {
text : 'View on Plunkr',
key : 'syntaxPlunkr',
icon : 'icon-arrow-down'
},
'jsfiddle' : {
text : 'View on JSFiddle',
key : 'syntaxFiddle',
icon : 'icon-cloud'
}
};
for(var type in types) {
var data = types[type];
var link = attrs[data.key];
if(link) {
html += makeLink(type, data.text, link, data.icon);
}
};
var nav = document.createElement('nav');
nav.className = 'syntax-links';
nav.innerHTML = html;
var node = element[0];
var par = node.parentNode;
par.insertBefore(nav, node);
}
}
}
directive.tabbable = function() {
return {
restrict: 'C',
compile: function(element) {
var navTabs = angular.element('<ul class="nav nav-tabs"></ul>'),
tabContent = angular.element('<div class="tab-content"></div>');
tabContent.append(element.contents());
element.append(navTabs).append(tabContent);
},
controller: ['$scope', '$element', function($scope, $element) {
var navTabs = $element.contents().eq(0),
ngModel = $element.controller('ngModel') || {},
tabs = [],
selectedTab;
ngModel.$render = function() {
var $viewValue = this.$viewValue;
if (selectedTab ? (selectedTab.value != $viewValue) : $viewValue) {
if(selectedTab) {
selectedTab.paneElement.removeClass('active');
selectedTab.tabElement.removeClass('active');
selectedTab = null;
}
if($viewValue) {
for(var i = 0, ii = tabs.length; i < ii; i++) {
if ($viewValue == tabs[i].value) {
selectedTab = tabs[i];
break;
}
}
if (selectedTab) {
selectedTab.paneElement.addClass('active');
selectedTab.tabElement.addClass('active');
}
}
}
};
this.addPane = function(element, attr) {
var li = angular.element('<li><a href></a></li>'),
a = li.find('a'),
tab = {
paneElement: element,
paneAttrs: attr,
tabElement: li
};
tabs.push(tab);
attr.$observe('value', update)();
attr.$observe('title', function(){ update(); a.text(tab.title); })();
function update() {
tab.title = attr.title;
tab.value = attr.value || attr.title;
if (!ngModel.$setViewValue && (!ngModel.$viewValue || tab == selectedTab)) {
// we are not part of angular
ngModel.$viewValue = tab.value;
}
ngModel.$render();
}
navTabs.append(li);
li.on('click', function(event) {
event.preventDefault();
event.stopPropagation();
if (ngModel.$setViewValue) {
$scope.$apply(function() {
ngModel.$setViewValue(tab.value);
ngModel.$render();
});
} else {
// we are not part of angular
ngModel.$viewValue = tab.value;
ngModel.$render();
}
});
return function() {
tab.tabElement.remove();
for(var i = 0, ii = tabs.length; i < ii; i++ ) {
if (tab == tabs[i]) {
tabs.splice(i, 1);
}
}
};
}
}]
};
};
directive.table = function() {
return {
restrict: 'E',
link: function(scope, element, attrs) {
element[0].className = 'table table-bordered table-striped code-table';
}
};
};
var popoverElement = function() {
var object = {
init : function() {
this.element = angular.element(
'<div class="popover popover-incode top">' +
'<div class="arrow"></div>' +
'<div class="popover-inner">' +
'<div class="popover-title"><code></code></div>' +
'<div class="popover-content"></div>' +
'</div>' +
'</div>'
);
this.node = this.element[0];
this.element.css({
'display':'block',
'position':'absolute'
});
angular.element(document.body).append(this.element);
var inner = this.element.children()[1];
this.titleElement = angular.element(inner.childNodes[0].firstChild);
this.contentElement = angular.element(inner.childNodes[1]);
//stop the click on the tooltip
this.element.bind('click', function(event) {
event.preventDefault();
event.stopPropagation();
});
var self = this;
angular.element(document.body).bind('click',function(event) {
if(self.visible()) self.hide();
});
},
show : function(x,y) {
this.element.addClass('visible');
this.position(x || 0, y || 0);
},
hide : function() {
this.element.removeClass('visible');
this.position(-9999,-9999);
},
visible : function() {
return this.position().y >= 0;
},
isSituatedAt : function(element) {
return this.besideElement ? element[0] == this.besideElement[0] : false;
},
title : function(value) {
return this.titleElement.html(value);
},
content : function(value) {
if(value && value.length > 0) {
value = marked(value);
}
return this.contentElement.html(value);
},
positionArrow : function(position) {
this.node.className = 'popover ' + position;
},
positionAway : function() {
this.besideElement = null;
this.hide();
},
positionBeside : function(element) {
this.besideElement = element;
var elm = element[0];
var x = elm.offsetLeft;
var y = elm.offsetTop;
x -= 30;
y -= this.node.offsetHeight + 10;
this.show(x,y);
},
position : function(x,y) {
if(x != null && y != null) {
this.element.css('left',x + 'px');
this.element.css('top', y + 'px');
}
else {
return {
x : this.node.offsetLeft,
y : this.node.offsetTop
};
}
}
};
object.init();
object.hide();
return object;
};
directive.popover = ['popoverElement', function(popover) {
return {
restrict: 'A',
priority : 500,
link: function(scope, element, attrs) {
element.bind('click',function(event) {
event.preventDefault();
event.stopPropagation();
if(popover.isSituatedAt(element) && popover.visible()) {
popover.title('');
popover.content('');
popover.positionAway();
}
else {
popover.title(attrs.title);
popover.content(attrs.content);
popover.positionBeside(element);
}
});
}
}
}];
directive.tabPane = function() {
return {
require: '^tabbable',
restrict: 'C',
link: function(scope, element, attrs, tabsCtrl) {
element.on('$remove', tabsCtrl.addPane(element, attrs));
}
};
};
directive.foldout = ['$http', '$animate','$window', function($http, $animate, $window) {
return {
restrict: 'A',
priority : 500,
link: function(scope, element, attrs) {
var container, loading, url = attrs.url;
if(/\/build\//.test($window.location.href)) {
url = '/build/docs' + url;
}
element.bind('click',function() {
scope.$apply(function() {
if(!container) {
if(loading) return;
loading = true;
var par = element.parent();
container = angular.element('<div class="foldout">loading...</div>');
$animate.enter(container, null, par);
$http.get(url, { cache : true }).success(function(html) {
loading = false;
html = '<div class="foldout-inner">' +
'<div calss="foldout-arrow"></div>' +
html +
'</div>';
container.html(html);
//avoid showing the element if the user has already closed it
if(container.css('display') == 'block') {
container.css('display','none');
$animate.addClass(container, 'ng-hide');
}
});
}
else {
container.hasClass('ng-hide') ? $animate.removeClass(container, 'ng-hide') : $animate.addClass(container, 'ng-hide');
}
});
});
}
}
}];
angular.module('bootstrap', [])
.directive(directive)
.factory('popoverElement', popoverElement)
.run(function() {
marked.setOptions({
gfm: true,
tables: true
});
});
-28
View File
@@ -1,28 +0,0 @@
@workInProgress
@ngdoc overview
@name angular.service
@description
The services API provides objects for carrying out common web app tasks. Service objects are
managed by angular's {@link guide/dev_guide.di dependency injection system}.
* {@link angular.service.$browser $browser } - Provides an instance of a browser object
* {@link angular.service.$cookieStore $cookieStore } - Provides key / value storage backed by
session cookies
* {@link angular.service.$cookies $cookies } - Provides read / write access to browser cookies
* {@link angular.service.$defer $defer } - Defers function execution and try / catch block
* {@link angular.service.$document $document } - Provides reference to `window.document` element
* {@link angular.service.$exceptionHandler $exceptionHandler } - Receives uncaught angular
exceptions
* {@link angular.service.$hover $hover } -
* {@link angular.service.$invalidWidgets $invalidWidgets } - Holds references to invalid widgets
* {@link angular.service.$location $location } - Parses the browser location URL
* {@link angular.service.$log $log } - Provides logging service
* {@link angular.service.$resource $resource } - Creates objects for interacting with RESTful
server-side data sources
* {@link angular.service.$route $route } - Provides deep-linking services
* {@link angular.service.$window $window } - References the browsers `window` object
* {@link angular.service.$xhr $xhr} - Generates an XHR request.
For information on how angular services work and how to write your own services, see {@link
guide/dev_guide.services Angular Services} in the angular Developer Guide.
+3 -70
View File
@@ -2,73 +2,6 @@
@name API Reference
@description
## Angular Compiler API
* {@link angular.widget Widgets} - Angular custom DOM element
* {@link angular.directive Directives} - Angular DOM element attributes
* {@link angular.markup Markup} and {@link angular.attrMarkup Attribute Markup}
* {@link angular.filter Filters} - Angular output filters
* {@link angular.formatter Formatters} - Angular converters for form elements
* {@link angular.validator Validators} - Angular input validators
* {@link angular.compile angular.compile()} - Template compiler
## Angular Scope API
* {@link angular.scope Scope Object} - Angular scope object
## Angular Services & Dependency Injection API
* {@link angular.service Angular Services}
* {@link angular.injector angular.injector() }
## Angular Testing API
* {@link angular.mock Testing Mocks API} - Mock objects for testing
* {@link
https://docs.google.com/document/d/11L8htLKrh6c92foV71ytYpiKkeKpM4_a5-9c3HywfIc/edit?hl=en_US
Angular Scenario Runner} - Automated scenario testing documentation
## Angular Utility Functions
### HTML & DOM Manipulation
* {@link angular.element angular.element()}
### Misc
* {@link angular.bind angular.bind() }
* {@link angular.extend angular.extend() }
* {@link angular.forEach angular.forEach() }
* {@link angular.identity angular.identity() }
* {@link angular.noop angular.noop() }
## Type Identification
* {@link angular.isArray angular.isArray() }
* {@link angular.isDate angular.isDate() }
* {@link angular.isDefined angular.isDefined() }
* {@link angular.isFunction angular.isFunction() }
* {@link angular.isNumber angular.isNumber() }
* {@link angular.isObject angular.isObject() }
* {@link angular.isString angular.isString() }
* {@link angular.isUndefined angular.isUndefined() }
## Strings
* {@link angular.lowercase angular.lowercase() }
* {@link angular.uppercase angular.uppercase() }
### JSON
* {@link angular.fromJson angular.fromJson() }
* {@link angular.toJson angular.toJson() }
## Utility methods for JavaScript types
* {@link angular.Object Object API} - Utility functions for JavaScript objects
* {@link angular.Array Array API} - Utility functions for JavaScript arrays
Use the API Reference documentation when you need more information about a specific feature. Check out
{@link guide/ Developer Guide} for AngularJS concepts. If you are new to AngularJS we recommend the
{@link tutorial/ Tutorial}.
+5
View File
@@ -0,0 +1,5 @@
@ngdoc overview
@name ng
@description
The `ng` is an angular module which contains all of the core angular services.
+68 -48
View File
@@ -1,4 +1,3 @@
@workInProgress
@ngdoc overview
@name Cookbook: Advanced Form
@description
@@ -9,12 +8,8 @@ detection, and preventing invalid form submission.
<doc:example>
<doc:source>
<script>
UserForm.$inject = ['$invalidWidgets'];
function UserForm($invalidWidgets){
this.$invalidWidgets = $invalidWidgets;
this.state = /^\w\w$/;
this.zip = /^\d\d\d\d\d$/;
this.master = {
function UserForm($scope) {
var master = {
name: 'John Smith',
address:{
line1: '123 Main St.',
@@ -26,56 +21,81 @@ detection, and preventing invalid form submission.
{type:'phone', value:'1(234) 555-1212'}
]
};
this.cancel();
$scope.state = /^\w\w$/;
$scope.zip = /^\d\d\d\d\d$/;
$scope.cancel = function() {
$scope.form = angular.copy(master);
};
$scope.save = function() {
master = $scope.form;
$scope.cancel();
};
$scope.addContact = function() {
$scope.form.contacts.push({type:'', value:''});
};
$scope.removeContact = function(contact) {
var contacts = $scope.form.contacts;
for (var i = 0, ii = contacts.length; i < ii; i++) {
if (contact === contacts[i]) {
contacts.splice(i, 1);
}
}
};
$scope.isCancelDisabled = function() {
return angular.equals(master, $scope.form);
};
$scope.isSaveDisabled = function() {
return $scope.myForm.$invalid || angular.equals(master, $scope.form);
};
$scope.cancel();
}
UserForm.prototype = {
cancel: function(){
this.form = angular.copy(this.master);
},
save: function(){
this.master = this.form;
this.cancel();
}
};
</script>
<div ng:controller="UserForm">
<div ng-controller="UserForm">
<label>Name:</label><br/>
<input type="text" name="form.name" ng:required/> <br/><br/>
<form name="myForm">
<label>Address:</label><br/>
<input type="text" name="form.address.line1" size="33" ng:required/> <br/>
<input type="text" name="form.address.city" size="12" ng:required/>,
<input type="text" name="form.address.state" size="2" ng:required ng:validate="regexp:state"/>
<input type="text" name="form.address.zip" size="5" ng:required
ng:validate="regexp:zip"/><br/><br/>
<label>Name:</label><br/>
<input type="text" ng-model="form.name" required/> <br/><br/>
<label>Contacts:</label>
[ <a href="" ng:click="form.contacts.$add()">add</a> ]
<div ng:repeat="contact in form.contacts">
<select name="contact.type">
<option>email</option>
<option>phone</option>
<option>pager</option>
<option>IM</option>
</select>
<input type="text" name="contact.value" ng:required/>
[ <a href="" ng:click="form.contacts.$remove(contact)">X</a> ]
</div>
<button ng:click="cancel()" ng:disabled="{{master.$equals(form)}}">Cancel</button>
<button ng:click="save()" ng:disabled="{{$invalidWidgets.visible() ||
master.$equals(form)}}">Save</button>
<label>Address:</label> <br/>
<input type="text" ng-model="form.address.line1" size="33" required/> <br/>
<input type="text" ng-model="form.address.city" size="12" required/>,
<input type="text" ng-model="form.address.state" size="2"
ng-pattern="state" required/>
<input type="text" ng-model="form.address.zip" size="5"
ng-pattern="zip" required/><br/><br/>
<label>Contacts:</label>
[ <a href="" ng-click="addContact()">add</a> ]
<div ng-repeat="contact in form.contacts">
<select ng-model="contact.type">
<option>email</option>
<option>phone</option>
<option>pager</option>
<option>IM</option>
</select>
<input type="text" ng-model="contact.value" required/>
[ <a href="" ng-click="removeContact(contact)">X</a> ]
</div>
<button ng-click="cancel()" ng-disabled="isCancelDisabled()">Cancel</button>
<button ng-click="save()" ng-disabled="isSaveDisabled()">Save</button>
</form>
<hr/>
Debug View:
<pre>form={{form}}
master={{master}}</pre>
<pre>form={{form}}</pre>
</div>
</doc:source>
<doc:scenario>
it('should enable save button', function(){
it('should enable save button', function() {
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
input('form.name').enter('');
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
@@ -84,13 +104,13 @@ master.$equals(form)}}">Save</button>
element(':button:contains(Save)').click();
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
});
it('should enable cancel button', function(){
it('should enable cancel button', function() {
expect(element(':button:contains(Cancel)').attr('disabled')).toBeTruthy();
input('form.name').enter('change');
expect(element(':button:contains(Cancel)').attr('disabled')).toBeFalsy();
element(':button:contains(Cancel)').click();
expect(element(':button:contains(Cancel)').attr('disabled')).toBeTruthy();
expect(element(':input[name=form.name]').val()).toEqual('John Smith');
expect(element(':input[ng\\:model="form.name"]').val()).toEqual('John Smith');
});
</doc:scenario>
</doc:example>
+25 -25
View File
@@ -1,10 +1,9 @@
@workInProgress
@ngdoc overview
@name Cookbook: Resources - Buzz
@description
External resources are URLs that provide JSON data, which are then rendered with the help of
templates. angular has a resource factory that can be used to give names to the URLs and then
templates. Angular has a resource factory that can be used to give names to the URLs and then
attach behavior to them. For example you can use the
{@link http://code.google.com/apis/buzz/v1/getting_started.html#background-operations| Google Buzz
API}
@@ -13,47 +12,48 @@ to retrieve Buzz activity and comments.
<doc:example>
<doc:source>
<script>
BuzzController.$inject = ['$resource'];
function BuzzController($resource) {
this.Activity = $resource(
BuzzController.$inject = ['$scope', '$resource'];
function BuzzController($scope, $resource) {
$scope.userId = 'googlebuzz';
$scope.Activity = $resource(
'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments',
{alt: 'json', callback: 'JSON_CALLBACK'},
{ get: {method: 'JSON', params: {visibility: '@self'}},
replies: {method: 'JSON', params: {visibility: '@self', comments: '@comments'}}
{ get: {method: 'JSONP', params: {visibility: '@self'}},
replies: {method: 'JSONP', params: {visibility: '@self', comments: '@comments'}}
});
}
BuzzController.prototype = {
fetch: function() {
this.activities = this.Activity.get({userId:this.userId});
},
expandReplies: function(activity) {
activity.replies = this.Activity.replies({userId: this.userId, activityId: activity.id});
$scope.fetch = function() {
$scope.activities = $scope.Activity.get({userId:this.userId});
}
$scope.expandReplies = function(activity) {
activity.replies = $scope.Activity.replies({userId: this.userId, activityId: activity.id});
}
};
</script>
<div ng:controller="BuzzController">
<input name="userId" value="googlebuzz"/>
<button ng:click="fetch()">fetch</button>
<div ng-controller="BuzzController">
<input ng-model="userId"/>
<button ng-click="fetch()">fetch</button>
<hr/>
<div class="buzz" ng:repeat="item in activities.data.items">
<div class="buzz" ng-repeat="item in activities.data.items">
<h1 style="font-size: 15px;">
<img ng:src="{{item.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
<a ng:href="{{item.actor.profileUrl}}">{{item.actor.name}}</a>
<a href ng:click="expandReplies(item)" style="float: right;">
<img ng-src="{{item.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
<a ng-href="{{item.actor.profileUrl}}">{{item.actor.name}}</a>
<a href ng-click="expandReplies(item)" style="float: right;">
Expand replies: {{item.links.replies[0].count}}
</a>
</h1>
{{item.object.content | html}}
<div class="reply" ng:repeat="reply in item.replies.data.items" style="margin-left: 20px;">
<img ng:src="{{reply.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
<a ng:href="{{reply.actor.profileUrl}}">{{reply.actor.name}}</a>:
<div class="reply" ng-repeat="reply in item.replies.data.items" style="margin-left: 20px;">
<img ng-src="{{reply.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
<a ng-href="{{reply.actor.profileUrl}}">{{reply.actor.name}}</a>:
{{reply.content | html}}
</div>
</div>
</div>
</doc:source>
<doc:scenario>
it('fetch buzz and expand', function() {
xit('fetch buzz and expand', function() {
element(':button:contains(fetch)').click();
expect(repeater('div.buzz').count()).toBeGreaterThan(0);
element('.buzz a:contains(Expand replies):first').click();
+99 -63
View File
@@ -1,4 +1,3 @@
@workInProgress
@ngdoc overview
@name Cookbook: Deep Linking
@description
@@ -6,7 +5,7 @@
Deep linking allows you to encode the state of the application in the URL so that it can be
bookmarked and the application can be restored from the URL to the same state.
While <angular/> does not force you to deal with bookmarks in any particular way, it has services
While Angular does not force you to deal with bookmarks in any particular way, it has services
which make the common case described here very easy to implement.
# Assumptions
@@ -28,88 +27,125 @@ controller.
In this example we have a simple app which consist of two screens:
* Welcome: url `#` Show the user contact information.
* Settings: url `#/settings` Show an edit screen for user contact information.
* Welcome: url `welcome` Show the user contact information.
* Settings: url `settings` Show an edit screen for user contact information.
<example module="deepLinking" deps="angular-route.js, angular-sanitize.js">
<file name="script.js">
angular.module('deepLinking', ['ngRoute', 'ngSanitize'])
.config(function($routeProvider) {
$routeProvider.
when("/welcome", {templateUrl:'welcome.html', controller:WelcomeCntl}).
when("/settings", {templateUrl:'settings.html', controller:SettingsCntl});
});
The two partials are defined in the following URLs:
AppCntl.$inject = ['$scope', '$route']
function AppCntl($scope, $route) {
$scope.$route = $route;
* {@link ./examples/settings.html}
* {@link ./examples/welcome.html}
// initialize the model to something useful
$scope.person = {
name:'anonymous',
contacts:[{type:'email', url:'anonymous@example.com'}]
};
}
<doc:example>
<doc:source>
<script>
AppCntl.$inject = ['$route']
function AppCntl($route) {
// define routes
$route.when("", {template:'./examples/welcome.html', controller:WelcomeCntl});
$route.when("/settings", {template:'./examples/settings.html', controller:SettingsCntl});
$route.parent(this);
function WelcomeCntl($scope) {
$scope.greet = function() {
alert("Hello " + $scope.person.name);
};
}
// initialize the model to something useful
this.person = {
name:'anonymous',
contacts:[{type:'email', url:'anonymous@example.com'}]
};
}
function SettingsCntl($scope, $location) {
$scope.cancel = function() {
$scope.form = angular.copy($scope.person);
};
function WelcomeCntl($route){}
WelcomeCntl.prototype = {
greet: function(){
alert("Hello " + this.person.name);
}
};
$scope.save = function() {
angular.copy($scope.form, $scope.person);
$location.path('/welcome');
};
function SettingsCntl(){
this.cancel();
}
SettingsCntl.prototype = {
cancel: function(){
this.form = angular.copy(this.person);
},
$scope.cancel();
}
</file>
<file name="style.css">
[ng-view] {
border: 1px solid blue;
margin: 0;
padding:1em;
}
save: function(){
angular.copy(this.form, this.person);
window.location.hash = "#";
}
};
</script>
<div ng:controller="AppCntl">
.partial-info {
background-color: blue;
color: white;
padding: 3px;
}
</file>
<file name="index.html">
<div ng-controller="AppCntl">
<h1>Your App Chrome</h1>
[ <a href="#">Welcome</a> | <a href="#/settings">Settings</a> ]
[ <a href="welcome">Welcome</a> | <a href="settings">Settings</a> ]
<hr/>
<span style="background-color: blue; color: white; padding: 3px;">
<span class="partial-info">
Partial: {{$route.current.template}}
</span>
<ng:view style="border: 1px solid blue; margin: 0; display:block; padding:1em;"></ng:view>
<div ng-view></div>
<small>Your app footer </small>
</div>
</doc:source>
<doc:scenario>
it('should navigate to URL', function(){
element('a:contains(Welcome)').click();
expect(element('ng\\:view').text()).toMatch(/Hello anonymous/);
element('a:contains(Settings)').click();
input('form.name').enter('yourname');
element(':button:contains(Save)').click();
element('a:contains(Welcome)').click();
expect(element('ng\\:view').text()).toMatch(/Hello yourname/);
</file>
<file name="settings.html">
<label>Name:</label>
<input type="text" ng:model="form.name" required>
<div ng:repeat="contact in form.contacts">
<select ng:model="contact.type">
<option>url</option>
<option>email</option>
<option>phone</option>
</select>
<input type="text" ng:model="contact.url">
[ <a href="" ng:click="form.contacts.$remove(contact)">X</a> ]
</div>
<div>
[ <a href="" ng:click="form.contacts.$add()">add</a> ]
</div>
<button ng:click="cancel()">Cancel</button>
<button ng:click="save()">Save</button>
</file>
<file name="welcome.html">
Hello {{person.name}},
<div>
Your contact information:
<div ng:repeat="contact in person.contacts">{{contact.type}}:
<span ng-bind-html="contact.url|linky"></span>
</div>
</div>
</file>
<file name="scenario.js">
it('should navigate to URL', function() {
element('a:contains(Welcome)').click();
expect(element('[ng-view]').text()).toMatch(/Hello anonymous/);
element('a:contains(Settings)').click();
input('form.name').enter('yourname');
element(':button:contains(Save)').click();
element('a:contains(Welcome)').click();
expect(element('[ng-view]').text()).toMatch(/Hello yourname/);
});
</doc:scenario>
</doc:example>
</file>
</example>
# Things to notice
* Routes are defined in the `AppCntl` class. The initialization of the controller causes the
initialization of the {@link api/angular.service.$route $route} service with the proper URL
routes.
* The {@link api/angular.service.$route $route} service then watches the URL and instantiates the
initialization of the {@link api/ngRoute.$route $route} service with the proper URL
routes.
* The {@link api/ngRoute.$route $route} service then watches the URL and instantiates the
appropriate controller when the URL changes.
* The {@link api/angular.widget.ng:view ng:view} widget loads the view when the URL changes. It
also
sets the view scope to the newly instantiated controller.
* The {@link api/ngRoute.directive:ngView ngView} widget loads the
view when the URL changes. It also sets the view scope to the newly instantiated controller.
* Changing the URL is sufficient to change the controller and view. It makes no difference whether
the URL is changed programatically or by the user.
+53 -40
View File
@@ -1,9 +1,8 @@
@workInProgress
@ngdoc overview
@name Cookbook: Form
@description
A web application's main purpose is to present and gather data. For this reason angular strives
A web application's main purpose is to present and gather data. For this reason Angular strives
to make both of these operations trivial. This example shows off how you can build a simple form to
allow a user to enter data.
@@ -11,76 +10,91 @@ allow a user to enter data.
<doc:example>
<doc:source>
<script>
function FormController(){
this.user = {
function FormController($scope) {
var user = $scope.user = {
name: 'John Smith',
address:{line1: '123 Main St.', city:'Anytown', state:'AA', zip:'12345'},
contacts:[{type:'phone', value:'1(234) 555-1212'}]
};
this.state = /^\w\w$/;
this.zip = /^\d\d\d\d\d$/;
$scope.state = /^\w\w$/;
$scope.zip = /^\d\d\d\d\d$/;
$scope.addContact = function() {
user.contacts.push({type:'email', value:''});
};
$scope.removeContact = function(contact) {
for (var i = 0, ii = user.contacts.length; i < ii; i++) {
if (contact === user.contacts[i]) {
$scope.user.contacts.splice(i, 1);
}
}
};
}
</script>
<div ng:controller="FormController" class="example">
<div ng-controller="FormController" class="example">
<label>Name:</label><br/>
<input type="text" name="user.name" ng:required/> <br/><br/>
<label>Name:</label><br>
<input type="text" ng-model="user.name" required/> <br><br>
<label>Address:</label><br/>
<input type="text" name="user.address.line1" size="33" ng:required/> <br/>
<input type="text" name="user.address.city" size="12" ng:required/>,
<input type="text" name="user.address.state" size="2" ng:required ng:validate="regexp:state"/>
<input type="text" name="user.address.zip" size="5" ng:required
ng:validate="regexp:zip"/><br/><br/>
<label>Address:</label><br>
<input type="text" ng-model="user.address.line1" size="33" required> <br>
<input type="text" ng-model="user.address.city" size="12" required>,
<input type="text" ng-model="user.address.state"
ng-pattern="state" size="2" required>
<input type="text" ng-model="user.address.zip" size="5"
ng-pattern="zip" required><br><br>
<label>Phone:</label>
[ <a href="" ng:click="user.contacts.$add()">add</a> ]
<div ng:repeat="contact in user.contacts">
<select name="contact.type">
[ <a href="" ng-click="addContact()">add</a> ]
<div ng-repeat="contact in user.contacts">
<select ng-model="contact.type">
<option>email</option>
<option>phone</option>
<option>pager</option>
<option>IM</option>
</select>
<input type="text" name="contact.value" ng:required/>
[ <a href="" ng:click="user.contacts.$remove(contact)">X</a> ]
<input type="text" ng-model="contact.value" required>
[ <a href="" ng-click="removeContact(contact)">X</a> ]
</div>
<hr/>
Debug View:
<pre>user={{user}}</pre>
<pre>user={{user | json}}</pre>
</div>
</doc:source>
<doc:scenario>
it('should show debug', function(){
it('should show debug', function() {
expect(binding('user')).toMatch(/John Smith/);
});
it('should add contact', function(){
it('should add contact', function() {
using('.example').element('a:contains(add)').click();
using('.example div:last').input('contact.value').enter('you@example.org');
expect(binding('user')).toMatch(/\(234\) 555\-1212/);
expect(binding('user')).toMatch(/you@example.org/);
});
it('should remove contact', function(){
it('should remove contact', function() {
using('.example').element('a:contains(X)').click();
expect(binding('user')).not().toMatch(/\(234\) 555\-1212/);
});
it('should validate zip', function(){
expect(using('.example').element(':input[name=user.address.zip]').attr('className'))
.not().toMatch(/ng-validation-error/);
it('should validate zip', function() {
expect(using('.example').
element(':input[ng\\:model="user.address.zip"]').
prop('className')).not().toMatch(/ng-invalid/);
using('.example').input('user.address.zip').enter('abc');
expect(using('.example').element(':input[name=user.address.zip]').attr('className'))
.toMatch(/ng-validation-error/);
expect(using('.example').
element(':input[ng\\:model="user.address.zip"]').
prop('className')).toMatch(/ng-invalid/);
});
it('should validate state', function(){
expect(using('.example').element(':input[name=user.address.state]').attr('className'))
.not().toMatch(/ng-validation-error/);
it('should validate state', function() {
expect(using('.example').element(':input[ng\\:model="user.address.state"]').prop('className'))
.not().toMatch(/ng-invalid/);
using('.example').input('user.address.state').enter('XXX');
expect(using('.example').element(':input[name=user.address.state]').attr('className'))
.toMatch(/ng-validation-error/);
expect(using('.example').element(':input[ng\\:model="user.address.state"]').prop('className'))
.toMatch(/ng-invalid/);
});
</doc:scenario>
</doc:example>
@@ -88,14 +102,13 @@ ng:validate="regexp:zip"/><br/><br/>
# Things to notice
* The user data model is initialized {@link api/angular.directive.ng:controller controller} and is
available in
the {@link api/angular.scope scope} with the initial data.
* The user data model is initialized {@link api/ng.directive:ngController controller} and is
available in the {@link api/ng.$rootScope.Scope scope} with the initial data.
* For debugging purposes we have included a debug view of the model to better understand what
is going on.
* The {@link api/angular.widget.HTML input widgets} simply refer to the model and are auto bound.
* The inputs {@link api/angular.validator validate}. (Try leaving them blank or entering non digits
in the zip field)
* The {@link api/ng.directive:input input directives} simply refer
to the model and are data-bound.
* The inputs validate. (Try leaving them blank or entering non digits in the zip field)
* In your application you can simply read from or write to the model and the form will be updated.
* By clicking the 'add' link you are adding new items into the `user.contacts` array which are then
reflected in the view.
+16 -9
View File
@@ -1,16 +1,22 @@
@workInProgress
@ngdoc overview
@name Cookbook: Hello World
@description
<doc:example>
<doc:source>
Your name: <input type="text" name="name" value="World"/>
<hr/>
Hello {{name}}!
<script>
function HelloCntl($scope) {
$scope.name = 'World';
}
</script>
<div ng-controller="HelloCntl">
Your name: <input type="text" ng-model="name"/>
<hr/>
Hello {{name || "World"}}!
</div>
</doc:source>
<doc:scenario>
it('should change the binding when user enters text', function(){
it('should change the binding when user enters text', function() {
expect(binding('name')).toEqual('World');
input('name').enter('angular');
expect(binding('name')).toEqual('angular');
@@ -22,10 +28,11 @@
Take a look through the source and note:
* The script tag that {@link guide/dev_guide.bootstrap bootstraps} the angular environment.
* The text {@link api/angular.widget.HTML input widget} which is bound to the greeting name text.
* No need for listener registration and event firing on change events.
* The implicit presence of the `name` variable which is in the root {@link api/angular.scope scope}.
* The script tag that {@link guide/bootstrap bootstraps} the Angular environment.
* The text {@link api/ng.directive:input input form control} which is
bound to the greeting name text.
* There is no need for listener registration and event firing on change events.
* The implicit presence of the `name` variable which is in the root {@link api/ng.$rootScope.Scope scope}.
* The double curly brace `{{markup}}`, which binds the name variable to the greeting text.
* The concept of {@link guide/dev_guide.templates.databinding data binding}, which reflects any
changes to the
+4 -5
View File
@@ -1,9 +1,8 @@
@workInProgress
@ngdoc overview
@name Cookbook
@description
Welcome to the angular cookbook. Here we will show you typical uses of angular by example.
Welcome to the Angular cookbook. Here we will show you typical uses of Angular by example.
# Hello World
@@ -45,8 +44,8 @@ allowing you to send links to specific screens in your app.
# Services
{@link api/angular.service Services}: Services are long lived objects in your applications that are
available across controllers. A collection of useful services are pre-bundled with angular but you
{@link api/ng Services}: Services are long lived objects in your applications that are
available across controllers. A collection of useful services are pre-bundled with Angular but you
will likely add your own. Services are initialized using dependency injection, which resolves the
order of initialization. This safeguards you from the perils of global state (a common way to
implement long lived objects).
@@ -56,4 +55,4 @@ implement long lived objects).
{@link buzz Resources}: Web applications must be able to communicate with the external
services to get and update data. Resources are the abstractions of external URLs which are
specially tailored to angular data binding.
specially tailored to Angular data binding.
+54 -53
View File
@@ -1,23 +1,22 @@
@workInProgress
@ngdoc overview
@name Cookbook: MVC
@description
MVC allows for a clean an testable separation between the behavior (controller) and the view
MVC allows for a clean and testable separation between the behavior (controller) and the view
(HTML template). A Controller is just a JavaScript class which is grafted onto the scope of the
view. This makes it very easy for the controller and the view to share the model.
The model is simply the controller's this. This makes it very easy to test the controller in
isolation since one can simply instantiate the controller and test without a view, because there is
no connection between the controller and the view.
The model is a set of objects and primitives that are referenced from the Scope ($scope) object.
This makes it very easy to test the controller in isolation since one can simply instantiate the
controller and test without a view, because there is no connection between the controller and the
view.
<doc:example>
<doc:source>
<script>
function TicTacToeCntl($location){
this.$location = $location;
this.cellStyle= {
function TicTacToeCntl($scope, $location) {
$scope.cellStyle= {
'height': '20px',
'width': '20px',
'border': '1px solid black',
@@ -25,30 +24,40 @@ no connection between the controller and the view.
'vertical-align': 'middle',
'cursor': 'pointer'
};
this.reset();
this.$watch('$location.hashSearch.board', this.readUrl);
}
TicTacToeCntl.prototype = {
dropPiece: function(row, col) {
if (!this.winner && !this.board[row][col]) {
this.board[row][col] = this.nextMove;
this.nextMove = this.nextMove == 'X' ? 'O' : 'X';
this.setUrl();
}
},
reset: function(){
this.board = [
$scope.reset = function() {
$scope.board = [
['', '', ''],
['', '', ''],
['', '', '']
];
this.nextMove = 'X';
this.winner = '';
this.setUrl();
},
grade: function(){
var b = this.board;
this.winner =
$scope.nextMove = 'X';
$scope.winner = '';
setUrl();
};
$scope.dropPiece = function(row, col) {
if (!$scope.winner && !$scope.board[row][col]) {
$scope.board[row][col] = $scope.nextMove;
$scope.nextMove = $scope.nextMove == 'X' ? 'O' : 'X';
setUrl();
}
};
$scope.reset();
$scope.$watch(function() { return $location.search().board;}, readUrl);
function setUrl() {
var rows = [];
angular.forEach($scope.board, function(row) {
rows.push(row.join(','));
});
$location.search({board: rows.join(';') + '/' + $scope.nextMove});
}
function grade() {
var b = $scope.board;
$scope.winner =
row(0) || row(1) || row(2) ||
col(0) || col(1) || col(2) ||
diagonal(-1) || diagonal(1);
@@ -56,44 +65,36 @@ no connection between the controller and the view.
function col(col) { return same(b[0][col], b[1][col], b[2][col]);}
function diagonal(i) { return same(b[0][1-i], b[1][1], b[2][1+i]);}
function same(a, b, c) { return (a==b && b==c) ? a : '';};
},
setUrl: function(){
var rows = [];
angular.forEach(this.board, function(row){
rows.push(row.join(','));
});
this.$location.hashSearch.board = rows.join(';') + '/' + this.nextMove;
},
readUrl: function(scope, value) {
}
function readUrl(value) {
if (value) {
value = value.split('/');
this.nextMove = value[1];
$scope.nextMove = value[1];
angular.forEach(value[0].split(';'), function(row, col){
this.board[col] = row.split(',');
}, this);
this.grade();
} else {
this.reset();
$scope.board[col] = row.split(',');
});
grade();
}
}
};
}
</script>
<h3>Tic-Tac-Toe</h3>
<div ng:controller="TicTacToeCntl">
<div ng-controller="TicTacToeCntl">
Next Player: {{nextMove}}
<div class="winner" ng:show="winner">Player {{winner}} has won!</div>
<div class="winner" ng-show="winner">Player {{winner}} has won!</div>
<table class="board">
<tr ng:repeat="row in board" style="height:15px;">
<td ng:repeat="cell in row" ng:style="cellStyle"
ng:click="dropPiece($parent.$index, $index)">{{cell}}</td>
<tr ng-repeat="row in board track by $index" style="height:15px;">
<td ng-repeat="cell in row track by $index" ng-style="cellStyle"
ng-click="dropPiece($parent.$index, $index)">{{cell}}</td>
</tr>
</table>
<button ng:click="reset()">reset board</button>
<button ng-click="reset()">reset board</button>
</div>
</doc:source>
<doc:scenario>
it('should play a game', function(){
it('should play a game', function() {
piece(1, 1);
expect(binding('nextMove')).toEqual('O');
piece(3, 1);
@@ -114,7 +115,7 @@ no connection between the controller and the view.
# Things to notice
* The controller is defined in JavaScript and has no reference to the rendering logic.
* The controller is instantiated by <angular/> and injected into the view.
* The controller is instantiated by Angular and injected into the view.
* The controller can be instantiated in isolation (without a view) and the code will still execute.
This makes it very testable.
* The HTML view is a projection of the model. In the above example, the model is stored in the
@@ -124,4 +125,4 @@ board variable.
* The view can call any controller function.
* In this example, the `setUrl()` and `readUrl()` functions copy the game state to/from the URL's
hash so the browser's back button will undo game steps. See deep-linking. This example calls {@link
api/angular.scope.$watch $watch()} to set up a listener that invokes `readUrl()` when needed.
api/ng.$rootScope.Scope#$watch $watch()} to set up a listener that invokes `readUrl()` when needed.
+6
View File
@@ -0,0 +1,6 @@
@ngdoc error
@name $animate:notcsel
@fullName Not class CSS selector
@description
Expecting a CSS selector for class. Class selectors must start with `.`, for example: `.my-class-name`.
@@ -0,0 +1,8 @@
@ngdoc error
@name $cacheFactory:iid
@fullName Invalid ID
@description
This error occurs when trying to create a new `cache` object via {@link api/ng.$cacheFactory} with an ID that was already used to create another cache object.
To resolve the error please use a different cache ID when calling `$cacheFactory`.
+49
View File
@@ -0,0 +1,49 @@
@ngdoc error
@name $compile:ctreq
@fullName Missing Required Controller
@description
This error occurs when {@link api/ng.$compile template compiler} tries process the directive that specifies the `require` option in a {@link guide/directive#directivedefinitionobject directive definition},
but the required directive controller is not present on the current DOM element (or its ancestor element, if `^` was specified).
To resolve this error ensure that there is no typo in the required controller name and that the required directive controller is present on the current element.
If the required controller is expected to be on a ancestor element, make ensure that you prefix the controller name in the `require` definition with `^`.
If the required controller is optionally requested, use `?` or `^?` to specify that.
Example of a directive that requires {@link api/ng.directive:ngModel ngModel} controller:
```
myApp.directive('myDirective', function() {
return {
require: 'ngModel',
...
}
}
```
This directive can then be used as:
```
<input ng-model="some.path" my-directive>
```
Example of a directive that optionally requires a {@link api/ng.directive:form form} controller from an ancestor:
```
myApp.directive('myDirective', function() {
return {
require: '^?form',
...
}
}
```
This directive can then be used as:
```
<form name="myForm">
<div>
<span my-directive></span>
</div>
</form>
```
+24
View File
@@ -0,0 +1,24 @@
@ngdoc error
@name $compile:iscp
@fullName Invalid Isolate Scope Definition
@description
When declaring isolate scope the scope definition object must be in specific format which starts with mode character (`@&=`) with an optional local name.
```
myModule.directive('directiveName', function factory() {
return {
...
scope: {
'attrName': '@', // OK
'attrName2': '=localName', // OK
'attrName3': 'name', // ERROR: missing mode @&=
'attrName4': ' = name', // ERROR: extra spaces
'attrName5': 'name=', // ERROR: must be prefixed with @&=
}
...
}
});
```
Please refer to the {@link guide/directive#directivedefinitionobject directive definition docs} to learn more about the api.
+16
View File
@@ -0,0 +1,16 @@
@ngdoc error
@name $compile:multidir
@fullName Multiple Directive Resource Contention
@description
This error occurs when multiple directives are applied to the same DOM element, and processing them would result in an collisions or unsupported configuration.
To resolve this issue remove one of the directives which is causing the collision.
Example scenarios of multiple incompatible directives applied to the same element include:
* Multiple directives requesting `isolated scope`.
* Multiple directives publishing a controller under the same name.
* Multiple directives declared with the `transclusion` option.
* Multiple directives attempting to define a `template` or `templateURL`.
@@ -0,0 +1,20 @@
@ngdoc error
@name $compile:nodomevents
@fullName Interpolated Event Attributes
@description
This error occurs when one tries to create a binding for event handler attributes like `onclick`, `onload`, `onsubmit`, etc.
There is no practical value in binding to these attributes and doing so only exposes your application to security vulnerabilities like XSS.
For these reasons binding to event handler attributes (all attributes that start with `on` and `formaction` attribute) is not supported.
An example code that would allow XSS vulnerability by evaluating user input in the window context could look like this:
```
<input ng-mode="username">
<div onclick="{{username}}">click me</div>
```
Since the `onclick` evaluates the value as JavaScript code in the window context, setting the `username` model to a value like `javascript:alert('PWND')` would result in script injection when the `div` is clicked.
@@ -0,0 +1,36 @@
@ngdoc error
@name $compile:nonassign
@fullName Non-Assignable Expression
@description
This error occurs when a directive defines an isolate scope property that support two-way data-binding (using the `=` mode in the {@link guide/directive#directivedefinitionobject directive definition}) but the directive is used with an expression that is not-assignable.
In order for the two-way data-binding to work, it must be possible to write new values back into the path defined with the expression.
For example, given a directive:
```
myModule.directive('myDirective', function factory() {
return {
...
scope: {
'bind': '=localValue'
}
...
}
});
```
Following are invalid uses of this directive:
```
<my-directive bind="1+2"> <!-- ERROR because `1+2=localValue` is an invalid statement -->
<my-directive bind="myFn()"> <!-- ERROR because `myFn()=localValue` is an invalid statement -->
```
To resolve this error, always use path expressions with scope properties that are two-way data-bound:
```
<my-directive bind="some.property">
<my-directive bind="some[3]['property']">
```
+20
View File
@@ -0,0 +1,20 @@
@ngdoc error
@name $compile:selmulti
@fullName Binding to Multiple Attribute
@description
Binding to the `multiple` attribute of `select` element is not supported since switching between multiple and single mode changes the {@link api/ng.directive:ngModel `ngModel`} object type from instance to array of instances which breaks the model semantics.
If you need to use different types of `select` elements in your template based on some variable, please use {@link api/ng.directive:ngIf ngIf} or {@link api/ng.directive:ngSwitch ngSwitch} directives to select one of them to be used at runtime.
Example with invalid usage:
```
<select ng-model="some.model" multiple="{{mode}}"></select>
```
Example that uses ngIf to pick one of the `select` elements based on a variable:
```
<select ng-if="mode == 'multiple'" ng-model="some.model" multiple></select>
<select ng-if="mode != 'multiple'" ng-model="some.model"></select>
```
+11
View File
@@ -0,0 +1,11 @@
@ngdoc error
@name $compile:tpload
@fullName Error Loading Template
@description
This error occurs when {@link api/ng.$compile `$compile`} attempts to fetch a template from some URL, and the request fails.
To resolve this error, ensure that the URL of the template is spelled correctly and resolves to correct absolute URL.
The [Chrome Developer Tools](https://developers.google.com/chrome-developer-tools/docs/network#network_panel_overview) might also be helpful in determining why the request failed.
If you are using {@link api/ng.$templateCache} to pre-load templates, ensure that the cache was populated with the template.
+30
View File
@@ -0,0 +1,30 @@
@ngdoc error
@name $compile:tplrt
@fullName Invalid Template Root
@description
When a directive is declared with `template` (or `templateUrl`) and `replace` mode on, the template must have exactly one root element.
Otherwise the replacement operation would result in a single element being replaced with multiple elements or nodes, which is unsupported and not commonly needed in practice.
For example a directive with definition:
```
myModule.directive('myDirective', function factory() {
return {
...
replace: true,
templateUrl: 'someUrl'
...
}
});
```
And a template provided at URL `someUrl`. The template must be an html fragment that has only a single root element, like the `div` element in this template:
```
<div><b>Hello</b> World!</div>
```
An an invalid template to be used with this directive is one that defines multiple root nodes or elements. For example:
```
<b>Hello</b> World!
```
+34
View File
@@ -0,0 +1,34 @@
@ngdoc error
@name $compile:uterdir
@fullName Unterminated Directive
@description
This error occurs when using multi-element directives and a `directive-start` attribute fails to form a matching pair with a corresponding `directive-end` attribute.
A `directive-start` should have a matching `directive-end` on a sibling node in the DOM. For instance,
```
<table>
<tr ng-repeat-start="item in list">I get repeated</tr>
<tr ng-repeat-end>I also get repeated</tr>
</table>
```
is a valid example.
This error can occur in several different ways. One is by leaving out the `directive-end` attribute, like so:
```
<div>
<span foo-start></span>
</div>
```
Another is by nesting a `directive-end` inside of `directive-start`, or vice versa:
```
<div>
<span foo-start><span foo-end></span></span>
</div>
```
To avoid this error, make sure each `directive-start` you use has a matching `directive-end` on a sibling node in the DOM.
+21
View File
@@ -0,0 +1,21 @@
@ngdoc error
@name $controller:noscp
@fullName Missing $scope object
@description
This error occurs when {@link api/ng.$controller $controller} service is called in order to instantiate a new controller but no scope is provided via `$scope` property of the locals map.
Example of incorrect usage that leads to this error:
```
$controller(MyController);
//or
$controller(MyController, {scope: newScope});
```
To fix the example above please provide a scope to the $controller call:
```
$controller(MyController, {$scope, newScope});
```
Please consult the {@link api/ng.$controller $controller} service api docs to learn more.
@@ -0,0 +1,9 @@
@ngdoc error
@name $httpBackend:noxhr
@fullName Unsupported XHR
@description
This error occurs in browsers that do not support XmlHttpRequest. AngularJS
supports Safari, Chrome, Firefox, Opera, IE8 and higher, and mobile browsers
(Android, Chrome Mobile, iOS Safari). To avoid this error, use an officially
supported browser.
+13
View File
@@ -0,0 +1,13 @@
@ngdoc overview
@name Error Reference
@description
Use the Error Reference manual to find information about error conditions in
your AngularJS app. Errors thrown in production builds of AngularJS will log
links to this site on the console.
Other useful references for debugging your app include:
- {@link api/ API Reference} for detailed information about specific features
- {@link guide/ Developer Guide} for AngularJS concepts
- {@link tutorial/ Tutorial} for getting started
+26
View File
@@ -0,0 +1,26 @@
@ngdoc error
@name $injector:cdep
@fullName Circular Dependency
@description
This error occurs when the {@link api/angular.injector $injector} tries to get
a service that depends on itself, either directly or indirectly. To fix this,
construct your dependency chain such that there are no circular dependencies.
For example:
```
angular.module('myApp', [])
.factory('myService', function (myService) {
// ...
})
.controller('MyCtrl', function ($scope, myService) {
// ...
});
```
When an instance of `MyCtrl` is created, the service `myService` will be created
by the `$injector`. `myService` depends on itself, which causes the `$injector`
to detect a circular dependency and throw the error.
For more information, see the {@link guide/di Dependency Injection Guide}.
+26
View File
@@ -0,0 +1,26 @@
@ngdoc error
@name $injector:itkn
@fullName Bad Injection Token
@description
This error occurs when using a bad token as a dependency injection annotation.
Dependency injection annotation tokens should always be strings. Using any other
type will cause this error to be thrown.
Examples of code with bad injection tokens include:
```
var myCtrl = function ($scope, $http) { /* ... */ };
myCtrl.$inject = ['$scope', 42];
myAppModule.controller('MyCtrl', ['$scope', {}, function ($scope, $timeout) {
// ...
}]);
```
The bad injection tokens are `42` in the first example and `{}` in the second.
To avoid the error, always use string literals for dependency injection annotation
tokens.
For an explanation of what injection annotations are and how to use them, refer
to the {@link guide/di Dependency Injection Guide}.
@@ -0,0 +1,7 @@
@ngdoc error
@name $injector:modulerr
@fullName Module Error
@description
This error occurs when a module fails to load due to some exception. The error
message above should provide additional context.
+26
View File
@@ -0,0 +1,26 @@
@ngdoc error
@name $injector:nomod
@fullName Module Unavailable
@description
This error occurs when trying to "re-open" a module that has not yet been defined.
To define a new module, call {@link api/angular.module angular.module} with a name
and an array of dependent modules, like so:
```
// When defining a module with no module dependencies,
// the requires array should be defined and empty.
var myApp = angular.module('myApp', []);
```
To retrieve a reference to the same module for further configuration, call
`angular.module` without the `requires` array.
```
var myApp = angular.module('myApp');
```
Calling `angular.module` without the `requires` array when the module has not yet
been defined causes this error to be thrown. To fix it, define your module with
a name and an empty array, as in the first example above.
+26
View File
@@ -0,0 +1,26 @@
@ngdoc error
@name $injector:pget
@fullName Provider Missing $get
@description
This error occurs when attempting to register a provider that does not have a
`$get` method. For example:
```
function BadProvider() {} // No $get method!
angular.module("myApp", [])
.provider('bad', BadProvider); // this throws the error
```
To fix the error, fill in the `$get` method on the provider like so:
```
function GoodProvider() {
this.$get = angular.noop;
}
angular.module("myApp", [])
.provider('good', GoodProvider);
```
For more information, refer to the {@link api/AUTO.$provide#provider
$provide.provider} api doc.
+26
View File
@@ -0,0 +1,26 @@
@ngdoc error
@name $injector:unpr
@fullName Unknown Provider
@description
This error results from the `$injector` being unable to resolve a required
dependency. To fix this, make sure the dependency is defined and spelled
correctly. For example:
```
angular.module('myApp', [])
.controller('myCtrl', ['myService', function (myService) {
// Do something with myService
}]);
```
This code will fail with `$injector:unpr` if `myService` is not defined. Making
sure each dependency is defined will fix the problem.
```
angular.module('myApp', [])
.service('myService', function () { /* ... */ })
.controller('myCtrl', ['myService', function (myService) {
// Do something with myService
}]);
```
+26
View File
@@ -0,0 +1,26 @@
@ngdoc error
@name $sce:insecurl
@fullName Processing of a Resource from Untrusted Source Blocked
@description
AngularJS' {@link api/ng.$sce#strictcontextualescaping Strict Contextual Escaping (SCE)} mode (enabled by default) has blocked loading a resource from an insecure URL.
Typically, this would occur if you're attempting to load an Angular template from an untrusted source.
It's also possible that a custom directive threw this error for a similar reason.
Angular only loads templates from trusted URLs (by calling {@link api/ng.$sce#getTrustedResourceUrl $sce.getTrustedResourceUrl} on the template URL).
By default, only URLs that belong to the same origin are trusted. These are urls with the same domain and protocol as the application document.
The {@link api/ng.directive:ngInclude ngInclude} directive and {@link guide/directive directives} that specify a `templateUrl` require a trusted resource URL.
To load templates from other domains and/or protocols, either adjust the {@link
api/ng.$sceDelegateProvider#resourceUrlWhitelist whitelist}/ {@link
api/ng.$sceDelegateProvider#resourceUrlBlacklist blacklist} or wrap the URL with a call to {@link
api/ng.$sce#trustAsResourceUrl $sce.trustAsResourceUrl}.
**Note**: The browser's {@link
https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest Same Origin
Policy} and {@link http://www.w3.org/TR/cors/ Cross-Origin Resource Sharing (CORS)} policy apply
that may further restrict whether the template is successfully loaded. (e.g. neither cross-domain
requests won't work on all browsers nor `file://` requests on some browsers)
@@ -0,0 +1,7 @@
@ngdoc error
@name $interpolate:interr
@fullName Interpolation Error
@description
This error occurs when interpolation fails due to some exception. The error
message above should provide additional context.
@@ -0,0 +1,12 @@
@ngdoc error
@name $interpolate:noconcat
@fullName Multiple Expressions
@description
This error occurs when performing an interpolation that concatenates multiple
expressions when a trusted value is required. Concatenating expressions makes
it hard to reason about whether some combination of concatenated values are
unsafe to use and could easily lead to XSS.
For more information about how AngularJS helps keep your app secure, refer to
the {@link api/ng.$sce $sce} API doc.
+11
View File
@@ -0,0 +1,11 @@
@ngdoc error
@name jqLite:nosel
@fullName Unsupported Selector Lookup
@description
In order to keep Angular small, Angular implements only a subset of the selectors in {@link api/angular.element#angularsjqlite jqLite}.
This error occurs when a jqLite instance is invoked with a selector other than this subset.
In order to resolve this error, rewrite your code to only use tag name selectors and manually traverse the DOM using the APIs provided by jqLite.
Alternatively, you can include a full version of jQuery, which Angular will automatically use and that will make all selectors available.
+7
View File
@@ -0,0 +1,7 @@
@ngdoc error
@name jqLite:offargs
@fullName Invalid jqLite#off() parameter
@description
This error occurs when trying to pass too many arguments to `jqLite#off`. Note
that `jqLite#off` does not support namespaces or selectors like jQuery.
+8
View File
@@ -0,0 +1,8 @@
@ngdoc error
@name jqLite:onargs
@fullName Invalid jqLite#on() Parameters
@description
This error occurs when trying to pass too many arguments to `jqLite#on`. Note
that `jqLite#on` does not support the `selector` or `eventData` parameters as
jQuery does.
@@ -0,0 +1,17 @@
@ngdoc error
@name $location:ihshprfx
@fullName Missing Hash Prefix
@description
This error occurs when {@link api/ng.$location $location} service is configured to use a hash prefix but this prefix was not present in a url that the `$location` service was asked to parse.
For example if you configure `$location` service with prefix `'!'`:
```
myApp.config(function($locationProvider) {
$locationProvider.prefix('!');
});
```
If you enter the app at url `http:/myapp.com/#/myView` this error will be throw.
The correct url for this configuration is `http:/myapp.com/#!/myView` (note the `'!'` after `'#'` symbol).
@@ -0,0 +1,8 @@
@ngdoc error
@name $location:ipthprfx
@fullName Invalid or Missing Path Prefix
@description
This error occurs when you configure the {@link api/ng.$location `$location`} service in the html5 mode, specify a base url for your application via `<base>` element and try to update the location with a path that doesn't match the base prefix.
To resolve this issue, please check the base url specified via the `<base>` tag in the head of your main html document, as well as the url that you tried to set the location to.
@@ -0,0 +1,9 @@
@ngdoc error
@name $location:isrcharg
@fullName Wrong $location.search() argument type
@description
To resolve this error, ensure that the first argument for the `$location.search` call is a `string` or an object.
You can use the stack trace associated with this error to identify the call site that caused this issue.
To learn more, please consult the {@link api/ng.$location `$location`} api docs.
+8
View File
@@ -0,0 +1,8 @@
@ngdoc error
@name ng:areq
@fullName Bad Argument
@description
AngularJS often asserts that certain values will be present and truthy using a
helper function. If the assertion fails, this error is thrown. To fix this problem,
make sure that the value the assertion expects is defined and truthy.
+29
View File
@@ -0,0 +1,29 @@
@ngdoc error
@name ng:btstrpd
@fullName App Already Bootstrapped with this Element
@description
Occurs when calling angular.bootstrap on an element that has already been bootstrapped.
This usually happens when you accidentally use both `ng-app` and `angular.bootstrap` to bootstrap an application.
```
<html>
...
<body ng-app="myApp">
<script>
angular.bootstrap(document.body, ['myApp']);
</script>
</body>
</html>
```
Note that for bootrapping purposes, the `<html>` element is the same as `document`, so the following will also throw an error.
```
<html>
...
<script>
angular.bootstrap(document, ['myApp']);
</script>
</html>
```
+10
View File
@@ -0,0 +1,10 @@
@ngdoc error
@name ng:cpi
@fullName Bad Copy
@description
This error occurs when attempting to copy an object to itself. Calling {@link
api/angular.copy angular.copy} with a `destination` object deletes
all of the elements or properties on `destination` before copying to it. Copying
an object to itself is not supported. Make sure to check your calls to
`angular.copy` and avoid copying objects or arrays to themselves.
+10
View File
@@ -0,0 +1,10 @@
@ngdoc error
@name ng:cpws
@fullName Copying Window or Scope
@description
Copying Window or Scope instances is not supported because of cyclical and self
references. Avoid copying windows and scopes, as well as any other cyclical or
self-referential structures. Note that trying to deep copy an object containing
cyclical references that is neither a window nor a scope will cause infinite
recursion and a stack overflow.
@@ -0,0 +1,27 @@
@ngdoc error
@name ngModel:nonassign
@fullName Non-Assignable Expression
@description
This error occurs when expression the {@link api/ng.directive:ngModel ngModel} directive is bound to is a non-assignable expression.
Examples using assignable expressions include:
```
<input ng-model="namedVariable">
<input ng-model="myObj.someProperty">
<input ng-model="indexedArray[0]">
```
Examples of non-assignable expressions include:
```
<input ng-model="foo + bar">
<input ng-model="42">
<input ng-model="'oops'">
<input ng-model="myFunc()">
```
Always make sure that the expression bound via `ngModel` directive can be assigned to.
For more information, see the {@link api/ng.directive:ngModel ngModel API doc}.
+13
View File
@@ -0,0 +1,13 @@
@ngdoc error
@name ngOptions:iexp
@fullName Invalid Expression
@description
This error occurs when 'ngOptions' is passed an expression that isn't in an expected form.
Here's an example of correct syntax:
```
<select ng-model="color" ng-options="c.name for c in colors">
```
For more information on valid expression syntax, see 'ngOptions' in {@link api/ng.directive:select select} directive docs.
@@ -0,0 +1,7 @@
@ngdoc error
@name ngPattern:noregexp
@fullName Expected Regular Expression
@description
This error occurs when 'ngPattern' is passed an expression that isn't a regular expression or doesn't have the expected format.
For more information on valid expression syntax, see 'ngPattern' in {@link api/ng.directive:select input} directive docs.
+22
View File
@@ -0,0 +1,22 @@
@ngdoc error
@name ngRepeat:dupes
@fullName Duplicate Key in Repeater
@description
Occurs if there are duplicate keys in an {@link api/ng.directive:ngRepeat ngRepeat} expression. Duplicate keys are banned because AngularJS uses keys to associate DOM nodes with items.
By default, collections are keyed by reference which is desirable for most common models but can be problematic for primitive types that are interned (share references).
For example the issue can be triggered by this *invalid* code:
```
<div ng-repeat="value in [4, 4]"></div>
```
To resolve this error either ensure that the items in the collection have unique identity of use the `track by` syntax to specify how to track the association between models and DOM.
To resolve the example above can be resolved by using `track by $index`, which will cause the items to be keyed by their position in the array instead of their value:
```
<div ng-repeat="value in [4, 4] track by $index"></div>
```
+12
View File
@@ -0,0 +1,12 @@
@ngdoc error
@name ngRepeat:iexp
@fullName Invalid Expression
@description
Occurs when there is a syntax error in an {@link api/ng.directive:ngRepeat ngRepeat}'s expression. The expression should be in the form '_item_ in _collection_[ track by _id_]'.
Be aware, the ngRepeat directive parses the expression using a regex before sending _collection_ and optionally _id_ to the AngularJS parser. This error comes from the regex parsing.
To resolve, identify and fix errors in the expression, paying special attention to the 'in' and 'track by' keywords in the expression.
Please consult the api documentation of {@link api/ng.directive:ngRepeat ngRepeat} to learn more about valid syntax.
+25
View File
@@ -0,0 +1,25 @@
@ngdoc error
@name ngRepeat:iidexp
@fullName Invalid Identifier
@description
Occurs when there is an error in the identifier part of {@link api/ng.directive:ngRepeat ngRepeat}'s expression.
To resolve, use either a valid identifier or a tuple (_key_, _value_) where both _key_ and _value_ are valid identifiers.
Examples of *invalid* syntax:
```
<div ng-repeat="33 in users"></div>
<div ng-repeat="someFn() in users"></div>
<div ng-repeat="some user in users"></div>
```
Examples of *valid* syntax:
```
<div ng-repeat="user in users"></div>
<div ng-repeat="(id, user) in userMap"></div>
```
Please consult the api documentation of {@link api/ng.directive:ngRepeat ngRepeat} to learn more about valid syntax.
+18
View File
@@ -0,0 +1,18 @@
@ngdoc error
@name $parse:isecfld
@fullName Referencing 'constructor' Field in Expression
@description
Occurs when an expression attempts to access an objects constructor field.
AngularJS bans constructor access from within expressions since constructor
access is a known way to execute arbitrary Javascript code.
To resolve this error, avoid constructor access. As a last resort, alias
the constructor and access it through the alias instead.
Example expression that would result in this error:
```
<div>{{user.constructor.name}}</div>
```
+10
View File
@@ -0,0 +1,10 @@
@ngdoc error
@name $parse:isecfn
@fullName Referencing Function Disallowed
@description
Occurs when an expression attempts to access the 'Function' object (constructor for all functions in JavaScript).
Angular bans access to Function from within expressions since constructor access is a known way to execute arbitrary Javascript code.
To resolve this error, avoid Function access.
+10
View File
@@ -0,0 +1,10 @@
@ngdoc error
@name $parse:lexerr
@fullName Lexer Error
@description
Occurs when an expression has a lexical error, for example a malformed number (0.5e-) or an invalid unicode escape.
The error message contains a more precise error.
To resolve, learn more about {@link guide/expression Angular expressions}, identify the error and fix the expression's syntax.
+9
View File
@@ -0,0 +1,9 @@
@ngdoc error
@name $parse:syntax
@fullName Syntax Error
@description
Occurs when there is a syntax error in an expression. These errors are thrown while compiling the expression.
The error message contains a more precise description of the error, including the location (column) in the expression where the error occurred.
To resolve, learn more about {@link guide/expression Angular expressions}, identify the error and fix the expression's syntax.
+9
View File
@@ -0,0 +1,9 @@
@ngdoc error
@name $parse:ueoe
@fullName Unexpected End of Expression
@description
Occurs when an expression is missing tokens at the end of the expression.
For example, forgetting a closing bracket in an expression will trigger this error.
To resolve, learn more about {@link guide/expression Angular expressions}, identify the error and fix the expression's syntax.
@@ -0,0 +1,9 @@
@ngdoc error
@name $resource:badargs
@fullName Too Many Arguments
@description
This error occurs when specifying too many arguments to a {@link api/ngResource.$resource `$resource`} action, such as `get`, `query` or any user-defined custom action.
These actions may take up to 4 arguments.
For more information, refer to the {@link api/ngResource.$resource `$resource`} API reference documentation.
+11
View File
@@ -0,0 +1,11 @@
@ngdoc error
@name $resource:badcfg
@fullName Response does not match configured parameter
@description
This error occurs when the {@link api/ngResource.$resource `$resource`} service expects a response that can be deserialized as an array, receives an object, or vice versa.
By default, all resource actions expect objects, except `query` which expects arrays.
To resolve this error, make sure your `$resource` configuration matches the actual format of the data returned from the server.
For more information, see the {@link api/ngResource.$resource `$resource`} API reference documentation.
+14
View File
@@ -0,0 +1,14 @@
@ngdoc error
@name $rootScope:infdig
@fullName Infinite $digest Loop
@description
This error occurs when the application's model becomes unstable and each `$digest` cycle triggers a state change and subsequent `$digest` cycle. Angular detects this situation and prevents an infinite loop from causing the browser to become unresponsive.
For example, the situation can occur by setting up a watch on a path and subsequently updating the same path when the value changes.
```
$scope.$watch('foo', function() {
$scope.foo = $scope.foo + 1;
});
```
+74
View File
@@ -0,0 +1,74 @@
@ngdoc error
@name $rootScope:inprog
@fullName Action Already In Progress
@description
At any point in time there can be only one `$digest` or $apply operation in progress.
The stack trace of this error allows you to trace the origin of the currently executing $apply or $digest call.
`$digest` or `$apply` are processing operational states of the Scope - data-structure in Angular that provides context for models and enables model mutation observation.
Trying to reenter a `$digest` or `$apply` while one of them is already in progress is typically a sign of programming error that needs to be fixed.
This error is often seen when interacting with an API that is sometimes sync and sometimes async.
For example:
```
function MyController() {
thirdPartyComponent.getData(function(someData) {
scope.$apply(function() {
scope.someData = someData;
});
});
}
```
The controller constructor is always instantiated from within an $apply cycle, so if the third-party component called our callback synchronously, we'd be trying to enter the $apply again.
To resolve this type of issue, either fix the api to be always synchronous or asynchronous or wrap the call to the api with setTimeout call to make it always asynchronous.
Other situation that leads to this error is when you are trying to reuse a function to by using it as a callback for code that is called by various apis inside and outside of $apply.
For example:
```
myApp.directive('myDirective', function() {
return {
link: function($scope, $element) {
function doSomeWork() {
$scope.$apply(function() {
// do work here, and update the model
};
}
$element.on('click', doSomeWork);
doSomeWork(); // << this will throw an exception because templates are compiled within $apply
}
}
});
```
The fix for the example above looks like this:
```
myApp.directive('myDirective', function() {
return {
link: function($scope, $element) {
function doSomeWork() {
// do work here, and update the model
}
$element.on('click', function() {
$scope.$apply(doSomeWork); // <<< the $apply call was moved to the callsite that doesn't execute in $apply call already
});
doSomeWork();
}
}
});
```
To learn more about Angular processing model please check out the {@link guide/concepts concepts doc} as well as the {@link api/ng.$rootScope.Scope api} doc.
@@ -0,0 +1,11 @@
@ngdoc error
@name $sanitize:badparse
@fullName Parsing Error while Sanitizing
@description
This error occurs when the HTML string passed to '$sanitize' can't be parsed by the sanitizer.
The error contains part of the html string that can't be parsed.
The parser is more strict than a typical browser parser, so it's possible that some obscure input would produce this error despite the string being recognized as valid HTML by a browser.
If a valid html code results in this error, please file a bug.
+8
View File
@@ -0,0 +1,8 @@
@ngdoc error
@name $sce:icontext
@fullName Invalid / Unknown SCE context
@description
The context enum passed to {@link api/ng.$sce#trustAs $sce.trustAs} was not recognized.
Please consult the list of {@link api/ng.$sce#contexts supported Strict Contextual Escaping (SCE) contexts}.
+15
View File
@@ -0,0 +1,15 @@
@ngdoc error
@name $sce:iequirks
@fullName IE8 in quirks mode is unsupported
@description
This error occurs when you are using AngularJS with {@link api/ng.$sce#strictcontextualescaping Strict Contextual Escaping (SCE)} mode enabled (the default) on IE8 or lower in quirks mode.
In this mode, IE8 allows one to execute arbitrary javascript by the use of the `expression()` syntax and is not supported.
Refer {@link http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx MSDN Blogs > IEBlog > Ending Expressions} to learn more about them.
To resolve this error please specify the proper doctype at the top of your main html document:
```
<!doctype html>
```
+8
View File
@@ -0,0 +1,8 @@
@ngdoc error
@name $sce:itype
@fullName String Value is Required for SCE Trust Call
@description
{@link api/ng.$sce#trustAs $sce.trustAs} requires a string value.
Read more about {@link api/ng.$sce#strictcontextualescaping Strict Contextual Escaping (SCE)} in AngularJS.

Some files were not shown because too many files have changed in this diff Show More