Socket
Socket
Sign inDemoInstall

@netlify/angular-runtime

Package Overview
Dependencies
7
Maintainers
23
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @netlify/angular-runtime

Netlify Angular Runtime - Run Angular seamlessly on Netlify.


Version published
Weekly downloads
1.1K
increased by7.64%
Maintainers
23
Install size
248 kB
Created
Weekly downloads
 

Changelog

Source

2.0.7 (2024-04-19)

Bug Fixes

  • remove onPreDev (#108) (1daee4e)

Readme

Source

Netlify Angular Runtime – Run Angular seamlessly on Netlify

Angular Runtime

This build plugin implements Angular Support on Netlify.

Table of Contents

Installation and Configuration

Netlify automatically detects Angular projects and sets up the latest version of this plugin. There's no further configuration needed from Netlify users.

Manual Installation

If you need to pin down this plugin to a fixed version, install it manually.

Create a netlify.toml in the root of your project. Your file should include the plugins section below:

[[plugins]]
  package = "@netlify/plugin-angular-universal"

Install it via your package manager:

npm install -D @netlify/plugin-angular-universal
# or
yarn add -D @netlify/plugin-angular-universal

Read more about file-based plugin installation in our docs.

Accessing Request and Context during Server-Side Rendering

During server-side rendering (SSR), you can access the incoming Request object and the Netlify-specific Context object via providers:

import type { Context } from "@netlify/edge-functions"

export class FooComponent {

  constructor(
    // ...
    @Inject('netlify.request') @Optional() request?: Request,
    @Inject('netlify.context') @Optional() context?: Context,
  ) {
    console.log(`Rendering Foo for path ${request?.url} from location ${context?.geo?.city}`)
    // ...
  }
  
}

Keep in mind that these will not be available on the client-side or during prerendering.

To test this in local development, run your Angular project using netlify serve:

netlify serve

CLI Usage

Requirements

To use the Angular Universal plugin while building and deploying with the CLI, you need to have netlify-cli v17.0.0 installed (or a later version).

Please also make sure to use ntl deploy --build (rather than ntl build && ntl deploy).

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

Contributing

We welcome contributions ❤️ - see the CONTRIBUTING.md file for details.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Keywords

FAQs

Last updated on 19 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc