Commit graph

30 commits

Author SHA1 Message Date
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
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
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
fd822bdaf9 chore(formating): clean code to be function() { 2011-10-11 11:01:46 -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
Igor Minar
a5607e3061 docs(API): various api doc fixes from Toni 2011-09-01 00:19:35 -07:00
Igor Minar
fe5240732d feat(strict mode): adding strict mode flag to all js files
the flag must be in all src and test files so that we get the benefit of
running in the strict mode even in jstd

the following script was used to modify all files:

for file in `find src test -name "*.js"`; do
  echo -e "'use strict';\n" > temp.txt
  cat $file >> temp.txt
  mv temp.txt $file
done
2011-07-18 12:12:55 -07:00
Igor Minar
b7cf7f2a79 doc(angular.annotate): properly disable doc snippet to avoid compiler warnings 2011-07-18 12:12:54 -07:00
Igor Minar
b4f18fc295 style(injector): remove extra semicolon 2011-07-18 04:47:39 +00:00
Igor Minar
a0b35161a6 fix(doc): fix all broken links 2011-07-16 01:15:37 -07:00
Mårten Dolk
77ba539f63 fix:injector: make injector compatible with Rhino (HtmlUnit) 2011-07-06 16:06:54 -07:00
Misko Hevery
8cad231bd2 Refactor injector to have invoke method for speed reasons 2011-06-08 15:21:31 -07:00
Igor Minar
c35b0a7907 yet another docs batch 2011-06-06 23:10:30 -07:00
Vojta Jina
297c9b5b89 Fix wrong links in source code 2011-06-06 22:52:01 -07:00
Igor Minar
885c3ad5dd fixing lint warnings 2011-03-28 23:15:28 -07:00
Igor Minar
a709dc19b8 adding an extra injector spec
- added a spec for dependency graph resolution
- also simplyfying cache presence check
2011-02-27 16:19:21 -08:00
Misko Hevery
fd6e5e3f31 replace smart-quotes with regular quotes 2011-02-18 14:02:21 -08:00
Misko Hevery
7d4aee31bb Auto create $inject property form the argument names. Any arg starting with $ or _ will be injected 2011-02-18 13:14:07 -08:00
Igor Minar
1777110958 split up services into individual files
- split up services into files under src/service
- split up specs into files under test/service
- rewrite all specs so that they don't depend on one global forEach
- get rid of obsolete code and tests in ng:switch
- rename mock $log spec from "$log" to "$log mock"
2011-02-15 11:01:53 -05:00
Misko Hevery
c2f2587a79 fixed example rendering, add tests for it. 2011-01-24 14:23:51 -08:00
Igor Minar
0a6cf70deb Rename angular.foreach to angular.forEach to make the api consistent.
camelcase is used for other angular functions and forEach is also
used by EcmaScript standard.

- rename the internal as well as the external function name
- tweak the implementation of the function so that it doesn't
  clober it self when we extend the angular object with an
  object that has a forEach property equal to this forEach function

Closes #85
2011-01-10 10:26:55 -08:00
Misko Hevery
47c454a315 change to keydown from keyup; add delayed $updateView
- There was a perceived lag when typing do to the fact that we were
   listening on the keyup event instead of keydown. The issue with
   keydown is that we can not read the value of the input field. To
   solve this we schedule a defer call and perform the model update
   then.

 - To prevent calling $eval on root scope too many times as well as to
   prevent drowning the browser with too many updates we now call the
   $eval only after 25ms and any additional requests get ignored. The
   new update service is called $updateView
2011-01-07 14:39:46 -08:00
Igor Minar
1430c6d6b1 renaming service property $creation to $eager
see changelog diff for more info
2011-01-04 18:03:55 -08:00
Igor Minar
3ea5941f0e removing support for 'eager-published' services 2011-01-04 16:40:41 -08:00
Igor Minar
6515adc118 docs for angular.injector 2010-11-24 22:50:34 -08:00
Misko Hevery
b467a50bc7 generate keyword for searches; improved layout of doc 2010-11-15 12:28:08 -08:00
Misko Hevery
d9abfe8a7e Introduced injector and $new to scope, and injection into link methods and controllers
- added angular.injector(scope, services, instanceCache) which returns inject
    - inject method can return, instance, or call function which have $inject
      property
    - initialize services with $creation=[eager|eager-publish] this means that
      only some of the services are now globally accessible
  - upgraded $become on scope to use injector hence respect the $inject property
    for injection
    - $become should not be run multiple times and will most likely be removed
      in future version
  - added $new on scope to create a child scope
     - $inject is respected on constructor function
  - simplified scopes so that they no longer have separate __proto__ for
    parent, api, behavior and instance this should speed up execution since
    scope will now create one __proto__ chain per scope (not three).

BACKWARD COMPATIBILITY WARNING:
  - services now need to have $inject instead of inject property for proper
    injection this breaks backward compatibility
  - not all services are now published into root scope
    (only: $location, $cookie, $window)
  - if you have widget/directive which uses services on scope
    (such as this.$xhr), you will now have to inject that service in
    (as it is not published on the root scope anymore)
2010-10-12 16:33:06 -07:00