One framework. Mobile & desktop.

Overview

Angular - One framework. Mobile & desktop.

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

www.angular.io

Contributing Guidelines · Submit an Issue · Blog

CI status   Angular on npm   Discord conversation


Documentation

Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website.

Advanced

Development Setup

Prerequisites

Setting Up a Project

Install the Angular CLI globally:

npm install -g @angular/cli

Create workspace:

ng new [PROJECT NAME]

Run the application:

cd [PROJECT NAME]
ng serve

Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.

Quickstart

Get started in 5 minutes.

Ecosystem

angular ecosystem logos

Changelog

Learn about the latest improvements.

Upgrading

Check out our upgrade guide to find out the best way to upgrade your project.

Contributing

Contributing Guidelines

Read through our contributing guidelines to learn about our submission process, coding rules and more.

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 labeled as help wanted or good first issue.

Code of Conduct

Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.

Community

Join the conversation and help the community.

Love Angular badge

Love Angular? Give our repo a star ⬆️ .

Comments
  • Update README.md with better formatting and clearer guides

    Update README.md with better formatting and clearer guides

    PR Checklist

    Please check if your PR fulfills the following requirements:

    • [x] The commit message follows our guidelines: https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit
    • [x] Tests for the changes have been added (for bug fixes / features)
    • [x] Docs have been added / updated (for bug fixes / features)

    PR Type

    What kind of change does this PR introduce?

    • [ ] Bugfix
    • [ ] Feature
    • [ ] Code style update (formatting, local variables)
    • [ ] Refactoring (no functional changes, no api changes)
    • [ ] Build related changes
    • [ ] CI related changes
    • [x] Documentation content changes
    • [ ] angular.io application / infrastructure changes
    • [ ] Other... Please describe:

    What is the current behavior?

    Issue Number: N/A

    What is the new behavior?

    Better grammar (formatting) and clearer guides

    Does this PR introduce a breaking change?

    • [ ] Yes
    • [x] No

    Other information

    This change improves formatting and has clearer guides.

    opened by SmashedFrenzy16 0
  • feat(devtools): create profiler for injector events in dev mode

    feat(devtools): create profiler for injector events in dev mode

    • [ ] Unit Tests

    Motivation

    Currently, understanding dependency injection in Angular requires a lot of context and has been sited in our surveys as one of the largest points of confusion that our users have with the framework. This PR is the beginning of our approach to make debugging dependency injection in Angular easier.

    Overview

    This commit introduces injector profiler callbacks in parts of the framework to emit injector events. It also introduces a default handler for these events. This default handler parses the stream of events to construct some data structures that will support new injector debug APIs. This commit introduces one of these new APIs getInjectedServices, which will be used by DevTools to implement some DI inspecting features. See comments in injector-profiler.ts for more implementation details.

    Why was this implemented with a profiler?

    • DI maps nicely to a stream of events.
    • There is the possibility of making the internal setInjectorProfiler function a public debug API in the future, so that users can implement their own handlers to debug DI events.

    Will this affect runtime performance?

    For production builds no. For dev builds there is some additional overhead from the default profiler handling injector events and holding debug data in memory. Logic in these handlers is minimal, WeakMaps are used for keeping track of data and constant time lookups. No loops are performed in these handlers.

    Will this affect bundle size?

    No. Dead code elimination should strip all the code used by this commit.

    detected: feature 
    opened by AleksanderBodurri 0
  • fix(compiler): type-only symbols incorrectly retained when downlevelling custom decorators

    fix(compiler): type-only symbols incorrectly retained when downlevelling custom decorators

    In #47167 an updateClassDeclaration call was swapped out with a createClassDeclaration which caused a regression where interface references were being retained when using a custom decorator in a project that has emitDecoratorMetadata enabled.

    These changes switch back to use updateClassDeclaration.

    Fixes #48448.

    action: review target: patch area: compiler 
    opened by crisbeto 0
  • docs(docs-infra): update precedence of binding dynamic example and commentary

    docs(docs-infra): update precedence of binding dynamic example and commentary

    PR Checklist

    Please check if your PR fulfills the following requirements:

    • [X] The commit message follows our guidelines: https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit
    • [ ] Tests for the changes have been added (for bug fixes / features)
    • [ ] Docs have been added / updated (for bug fixes / features)

    PR Type

    What kind of change does this PR introduce?

    • [ ] Bugfix
    • [ ] Feature
    • [ ] Code style update (formatting, local variables)
    • [ ] Refactoring (no functional changes, no api changes)
    • [ ] Build related changes
    • [ ] CI related changes
    • [ ] Documentation content changes
    • [X] angular.io application / infrastructure changes
    • [ ] Other... Please describe:

    What is the current behavior?

    Solving the problem open in issue: https://github.com/angular/angular/issues/47784

    Issue Number: #47784

    What is the new behavior?

    Comment and example code update.

    Does this PR introduce a breaking change?

    • [ ] Yes
    • [X] No

    Other information

    area: docs 
    opened by ferrorenan 0
  • Security Vulnerability in JSON5 CVE-2022-46175

    Security Vulnerability in JSON5 CVE-2022-46175

    Which @angular/* package(s) are the source of the bug?

    compiler-cli

    Is this a regression?

    Yes

    Description

    Hi there, We have been notified of a vulnerability related to JSON5 used as a transitive dependency in our Angular 13 project. I wanted to ask you if you are going to plan to have a release for version 13 by upgrading to a new version of JSON5 ?

    Please provide a link to a minimal reproduction of the bug

    https://github.com/json5/json5/security/advisories/GHSA-9c47-m6qq-7p4h

    Please provide the exception or error you saw

    No response

    Please provide the environment you discovered this bug in (run ng version)

    Angular CLI: 13.3.8
    Node: 14.18.1
    Package Manager: npm 6.14.15
    
    @angular-devkit/architect       0.1303.8
    @angular-devkit/build-angular   13.3.8
    @angular-devkit/core            13.3.8
    @angular-devkit/schematics      13.3.8
    @angular/cli                    13.3.8
    @schematics/angular             13.3.8
    rxjs                            6.6.7
    typescript                      4.6.4
    

    Anything else?

    No response

    opened by pariaSadatHosseiny 0
  • Handle JWT automatically

    Handle JWT automatically

    Which @angular/* package(s) are relevant/related to the feature request?

    No response

    Description

    Would like to suggest Angular to be able to handle JWT automatically, just like it does for CSRF protection. It would be good for Angular to have this built-in, rather than rely on third party solution.

    Proposed solution

    Upon receiving request containing "Authorization" header, Angular can simply extract its value, and later automatically include an "Authorization" header in the response for all further requests. Of course there could be settings to enable or disable this auto feature

    Alternatives considered

    Currently the way is to manually write typescript code in the login component to extract the "Authorization" header after successfully login, and manually write code in my custom interceptor class to include the same header and value to all requests (except for specific request, such as accessing login input page)

    opened by hannah23280 0
Releases(15.1.0-next.3)
  • 15.1.0-next.3(Dec 14, 2022)

    15.1.0-next.3 (2022-12-14)

    animations

    | Commit | Description | | -- | -- | | fix - c86484507f | fix incorrect handling of camel-case css properties (#48436) |

    common

    | Commit | Description | | -- | -- | | feat - fe50813664 | Add BrowserPlatformLocation to the public API (#48488) | | fix - e362214924 | Fix TestBed.overrideProvider type to include multi (#48424) | | fix - d87285c363 | Update Location to get a normalized URL valid in case a represented URL starts with the substring equals APP_BASE_HREF (#48394) |

    compiler-cli

    | Commit | Description | | -- | -- | | fix - a6849f27af | evaluate const tuple types statically (#48091) |

    router

    | Commit | Description | | -- | -- | | feat - f58ad86e51 | Add feature provider for enabling hash navigation (#48301) |

    Special Thanks

    Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, BrowserPerson, Jens, Jessica Janiuk, Joey Perrott, JoostK, Konstantin Kharitonov, Lukas Matta, Matthieu Riegler, Piotr Kowalski, Virginia Dooley, Yannick Baron, dario-piotrowicz, lsst25, piyush132000 and why520crazy

    Source code(tar.gz)
    Source code(zip)
  • 15.0.4(Dec 14, 2022)

    15.0.4 (2022-12-14)

    animations

    | Commit | Description | | -- | -- | | fix - 6c1064c72f | fix incorrect handling of camel-case css properties (#48436) |

    common

    | Commit | Description | | -- | -- | | fix - f30d18a942 | Fix TestBed.overrideProvider type to include multi (#48424) | | fix - 59c6bfb632 | Update Location to get a normalized URL valid in case a represented URL starts with the substring equals APP_BASE_HREF (#48394) |

    compiler-cli

    | Commit | Description | | -- | -- | | fix - b55d2dab5d | evaluate const tuple types statically (#48091) |

    Special Thanks

    Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, BrowserPerson, Jens, Jessica Janiuk, Joey Perrott, JoostK, Konstantin Kharitonov, Lukas Matta, Piotr Kowalski, Virginia Dooley, Yannick Baron, dario-piotrowicz, lsst25, piyush132000 and why520crazy

    Source code(tar.gz)
    Source code(zip)
  • 15.1.0-next.2(Dec 7, 2022)

    15.1.0-next.2 (2022-12-07)

    common

    | Commit | Description | | -- | -- | | fix - 8e52ca2714 | Don't generate srcsets with very large sources (#47997) | | fix - f8ecc194e9 | Update Location to support base href containing origin (#48327) |

    compiler

    | Commit | Description | | -- | -- | | fix - 4c023956d8 | make sure selectors inside container queries are correctly scoped (#48353) |

    compiler-cli

    | Commit | Description | | -- | -- | | fix - 27eaded62d | Produce diagnostic rather than crash when using invalid hostDirective (#48314) |

    core

    | Commit | Description | | -- | -- | | feat - 38421578a2 | Make the isStandalone() function available in public API (#48114) | | feat - dd42974b07 | support TypeScript 4.9 (#48005) | | fix - 5f9c7ceb90 | unable to inject ChangeDetectorRef inside host directives (#48355) |

    Special Thanks

    Alan Agius, Alex Castle, Andrew Kushnir, Andrew Scott, Bob Watson, Charles Lyding, Derek Cormier, Joey Perrott, Konstantin Kharitonov, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, dario-piotrowicz, piyush132000 and sr5434

    Source code(tar.gz)
    Source code(zip)
  • 15.0.3(Dec 7, 2022)

    15.0.3 (2022-12-07)

    common

    | Commit | Description | | -- | -- | | fix - 50b1c2bf52 | Don't generate srcsets with very large sources (#47997) | | fix - bf44dc234a | Update Location to support base href containing origin (#48327) |

    compiler

    | Commit | Description | | -- | -- | | fix - 9a5d84249a | make sure selectors inside container queries are correctly scoped (#48353) |

    compiler-cli

    | Commit | Description | | -- | -- | | fix - 167bc0d163 | Produce diagnostic rather than crash when using invalid hostDirective (#48314) |

    core

    | Commit | Description | | -- | -- | | fix - e4dcaa513e | unable to inject ChangeDetectorRef inside host directives (#48355) |

    Special Thanks

    Alan Agius, Alex Castle, Andrew Kushnir, Andrew Scott, Bob Watson, Derek Cormier, Joey Perrott, Konstantin Kharitonov, Kristiyan Kostadinov, Paul Gschwendtner, Pawel Kozlowski, dario-piotrowicz and piyush132000

    Source code(tar.gz)
    Source code(zip)
  • 15.1.0-next.1(Nov 30, 2022)

    15.1.0-next.1 (2022-11-30)

    Deprecations

    router

    • CanLoad guards in the Router are deprecated. Use CanMatch instead.

    compiler-cli

    | Commit | Description | | -- | -- | | fix - 7d88700933 | accept inheriting the constructor from a class in a library (#48156) |

    router

    | Commit | Description | | -- | -- | | docs - 228e992db7 | Deprecate canLoad guards in favor of canMatch (#48180) | | feat - 332461bd0c | Add ability to override onSameUrlNavigation default per-navigation (#48050) |

    Special Thanks

    Alan Agius, Andrew Scott, Aristeidis Bampakos, Bob Watson, Derek Cormier, Dylan Hunn, JoostK, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Rokas Brazdžionis and piyush132000

    Source code(tar.gz)
    Source code(zip)
  • 15.0.2(Nov 30, 2022)

    15.0.2 (2022-11-30)

    compiler-cli

    | Commit | Description | | -- | -- | | fix - 86a21f5569 | accept inheriting the constructor from a class in a library (#48156) |

    Special Thanks

    Alan Agius, Andrew Scott, Aristeidis Bampakos, Bob Watson, Derek Cormier, JoostK, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Rokas Brazdžionis, mgechev and piyush132000

    Source code(tar.gz)
    Source code(zip)
  • 15.1.0-next.0(Nov 23, 2022)

    15.1.0-next.0 (2022-11-22)

    Deprecations

    router

    • router writable properties

      The following strategies are meant to be configured by registering the application strategy in DI via the providers in the root NgModule or bootstrapApplication:

      • routeReuseStrategy
      • titleStrategy
      • urlHandlingStrategy

      The following options are meant to be configured using the options available in RouterModule.forRoot or provideRouter.

      • onSameUrlNavigation
      • paramsInheritanceStrategy
      • urlUpdateStrategy
      • canceledNavigationResolution

      The following options are available in RouterModule.forRoot but not available in provideRouter:

      • malformedUriErrorHandler - This was found to not be used anywhere internally.
      • errorHandler - Developers can instead subscribe to Router.events and filter for NavigationError.

    common

    | Commit | Description | | -- | -- | | fix - b0a62bea47 | Fix MockPlatformLocation events and missing onPopState implementation (#48113) |

    core

    | Commit | Description | | -- | -- | | feat - 6acae1477a | Add TestBed.runInInjectionContext to help test functions which use inject (#47955) |

    forms

    | Commit | Description | | -- | -- | | fix - 0329c13e95 | don't mutate validators array (#47830) | | fix - d321880440 | FormBuilder.group return right type with shorthand parameters. (#48084) |

    language-service

    | Commit | Description | | -- | -- | | feat - 5f0b53c735 | Allow auto-imports to suggest multiple possible imports. (#47787) | | fix - fd2eea5961 | correctly handle host directive inputs/outputs (#48147) | | fix - ce8160ecb2 | Prevent crashes on unemitable references (#47938) | | fix - 764fa3d9c3 | update packages/language-service/build.sh script to work with vscode-ng-language-service's new Bazel build (#48120) |

    router

    | Commit | Description | | -- | -- | | docs - 0a8b8a66cd | Deprecate public members of Router that are meant to be configured elsewhere (#48006) | | feat - 73f03ad2d2 | Add new NavigationSkipped event for ignored navigations (#48024) | | fix - b51929a394 | correct type of nextState parameter in canDeactivate (#48038) | | fix - 1df0ed7d6e | Ensure renavigating in component init works with enabledBlocking (#48063) | | fix - 1976e37475 | restore 'history.state' on popstate even if navigationId missing (#48033) |

    Special Thanks

    Alan Agius, Andrew Kushnir, Andrew Scott, Bjarki, Bob Watson, Brooke, Derek Cormier, Dylan Hunn, George Kalpakas, Greg Magolan, Ikko Ashimine, Ivan Rodriguez, Jessica Janiuk, JiaLiPassion, Joe Roxbury, Joey Perrott, Kristiyan Kostadinov, Matthieu Riegler, Mikhail Savchuk, Nebojsa Cvetkovic, Pawel Kozlowski, Volodymyr, Wooshaah and mgechev

    Source code(tar.gz)
    Source code(zip)
  • 15.0.1(Nov 23, 2022)

    15.0.1 (2022-11-22)

    common

    | Commit | Description | | -- | -- | | fix - 930af9dd26 | Fix MockPlatformLocation events and missing onPopState implementation (#48113) |

    forms

    | Commit | Description | | -- | -- | | fix - b342e55509 | don't mutate validators array (#47830) | | fix - a12a120272 | FormBuilder.group return right type with shorthand parameters. (#48084) |

    language-service

    | Commit | Description | | -- | -- | | fix - cc8b76ef7c | correctly handle host directive inputs/outputs (#48147) | | fix - a8c33bf931 | update packages/language-service/build.sh script to work with vscode-ng-language-service's new Bazel build (#48120) |

    router

    | Commit | Description | | -- | -- | | fix - e4309d57d8 | correct type of nextState parameter in canDeactivate (#48038) | | fix - 9baefd085f | Ensure renavigating in component init works with enabledBlocking (#48063) | | fix - fa5528fb5f | restore 'history.state' on popstate even if navigationId missing (#48033) |

    Special Thanks

    Alan Agius, Andrew Scott, Bjarki, Bob Watson, Brooke, Derek Cormier, Dylan Hunn, George Kalpakas, Greg Magolan, Ikko Ashimine, Ivan Rodriguez, Jessica Janiuk, Joe Roxbury, Joey Perrott, Kristiyan Kostadinov, Matthieu Riegler, Mikhail Savchuk, Nebojsa Cvetkovic, Pawel Kozlowski, Volodymyr and Wooshaah

    Source code(tar.gz)
    Source code(zip)
  • 12.2.17(Nov 22, 2022)

    12.2.17 (2022-11-22)

    Breaking Changes

    core

    • Existing iframe usages may have security-sensitive attributes applied as an attribute or property binding in a template or via host bindings in a directive. Such usages would require an update to ensure compliance with the new stricter rules around iframe bindings.

    core

    | Commit | Description | | -- | -- | | fix - b871db57da | hardening attribute and property binding rules for