Go to file
Alex Rickabaugh 5be186035f feat(ivy): enable inheritance of factory functions in definitions (#25392)
This commit creates an API for factory functions which allows them
to be inherited from one another. To do so, it differentiates between
the factory function as a wrapper for a constructor and the factory
function in ngInjectableDefs which is determined by a default
provider.

The new form is:

factory: (t?) => new (t || SomeType)(inject(Dep1), inject(Dep2))

The 't' parameter allows for constructor inheritance. A subclass with
no declared constructor inherits its constructor from the superclass.
With the 't' parameter, a subclass can call the superclass' factory
function and use it to create an instance of the subclass.

For @Injectables with configured providers, the factory function is
of the form:

factory: (t?) => t ? constructorInject(t) : provider();

where constructorInject(t) creates an instance of 't' using the
naturally declared constructor of the type, and where provider()
creates an instance of the base type using the special declared
provider on @Injectable.

PR Close #25392
2018-08-09 09:58:13 -07:00
.circleci ci: enforce formatting of .bzl files (#23544) 2018-08-08 13:12:07 -07:00
.github build: sync g3 exclude list from copybara to ngbot (#24224) 2018-05-31 10:07:45 -07:00
aio docs: copy edit architecture guide (#25328) 2018-08-08 13:12:53 -07:00
docs docs: fix typo (#25331) 2018-08-06 13:36:09 -07:00
integration build: stop printing source-map-support warning (#25339) 2018-08-08 19:02:57 -07:00
modules test: fix typings for `DoneFn` (#25163) 2018-07-27 11:13:32 -07:00
packages feat(ivy): enable inheritance of factory functions in definitions (#25392) 2018-08-09 09:58:13 -07:00
scripts build: skip ivy builds when not publishing (#25299) 2018-08-04 14:17:00 -07:00
tools style: format .bzl files with buildifier (#23544) 2018-08-08 13:12:07 -07:00
.bowerrc chore(dgeni): clean up legacy typings bundle creation 2015-10-29 21:19:59 +00:00
.clang-format feat(tooling): Add a .clang-format for automated JavaScript formatting. 2015-04-02 08:44:34 -07:00
.editorconfig chore(.editorconfig): include markdown config 2015-01-27 00:14:48 -08:00
.gitattributes chore: force lf EOL for ts files (#11143) 2016-08-29 12:41:58 -07:00
.gitignore build: update Bazel dependency to 0.11.1 (#23297) 2018-04-10 23:01:30 -07:00
.mailmap build: add a Git .mailmap with my new name (#19550) 2017-10-09 14:35:30 -07:00
.nvmrc build: update node version number in .nvmrc (#20832) 2017-12-12 11:56:18 -08:00
.pullapprove.yml ci: update pullapprove groups and add docs (#25257) 2018-08-01 15:53:41 -07:00
.travis.yml ci: remove travis e2e_2 job (#22810) 2018-04-13 16:30:50 -07:00
BUILD.bazel test(upgrade): run tests against AngularJS v1.7.x as well (#25231) 2018-08-01 14:10:21 -07:00
CHANGELOG.md docs: Clarify breaking change in minor release (#25393) 2018-08-08 13:06:58 -07:00
CODE_OF_CONDUCT.md docs: fix community tab in GitHub by copying CoC 2018-02-27 19:02:30 -08:00
CONTRIBUTING.md docs: change `aio` scope to `docs-infra` (#24410) 2018-06-12 11:36:14 -07:00
LICENSE docs(common): update copyright years (#21232) 2018-01-04 17:45:36 -05:00
README.md docs: improve the GitHub README.md, update links, etc 2018-05-03 13:26:12 -07:00
WORKSPACE build: stop printing source-map-support warning (#25339) 2018-08-08 19:02:57 -07:00
bower.json docs: branding fixes (#14132) 2017-01-27 15:03:11 -06:00
browser-providers.conf.js build: remove required BrowserStack run as it fails with “Access denied” (#19769) 2017-10-17 15:51:40 -07:00
build.sh build: upgrade jasmine (and related typings) to latest version (#19904) 2018-07-06 13:48:02 -07:00
gulpfile.js test: migrate remaining public-api tests to Bazel (#22639) 2018-03-09 09:11:40 -08:00
index.bzl style: format .bzl files with buildifier (#23544) 2018-08-08 13:12:07 -07:00
karma-js.conf.js fix(router): take base uri into account in `setUpLocationSync()` (#20244) 2018-08-06 11:11:07 -07:00
package.json ci: enforce formatting of .bzl files (#23544) 2018-08-08 13:12:07 -07:00
protractor-e2e.conf.js refactor: add license header to JS files & format files (#12081) 2016-10-04 20:39:20 -07:00
protractor-examples-e2e.conf.js refactor: format and lint code 2016-12-12 11:30:25 -08:00
protractor-perf.conf.js build(bazel): fix broken travis CI (#24788) 2018-07-24 08:26:16 -07:00
shims_for_IE.js Revert "refactor: add license header to JS files & format files (#12035)" 2016-10-04 14:06:41 -07:00
test-events.js fix(platform-browser): run BLACK_LISTED_EVENTS outside of ngZone (#18993) 2017-09-05 15:33:22 -05:00
test-main.js refactor(core): remove withBody from public testing API (#25171) 2018-07-31 15:09:32 -07:00
test.sh feat: typescript 2.9 support (#24652) 2018-07-03 13:32:06 -07:00
tslint.json build: add lint rule for global flags in rollup config (#20028) 2017-10-30 23:09:16 -04:00
yarn.lock test(upgrade): run tests against AngularJS v1.7.x as well (#25231) 2018-08-01 14:10:21 -07:00
yarn.lock.readme.md docs: replace npm with yarn in lockfile readme (#25309) 2018-08-06 13:38:13 -07:00

README.md

Build Status CircleCI BrowserStack Status Join the chat at https://gitter.im/angular/angular npm version

Angular

Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages.

Quickstart

Get started in 5 minutes.

Changelog

Learn about the latest improvements.

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.