Table of Contents

Angular Loader (JS-Helper)

This is an extension for 2sxc Apps and can be installed into each App individually.

Whit this Extension, you can easily load Angular apps into your DNN environment. It handles loading the Angular framework and your app code.

Optionally, it can also handle loading different editions of your app (e.g. dev vs. prod) using the JS App Editions extension.

Installation

Usage

  1. First, build your Angular app and place the output files into the appropriate (e.g. /angular-demo/angular/browser) folder in your app.
  2. Insert this code into your Razor view where you want to load the Angular app:
@inherits Custom.Hybrid.RazorTyped

@Html.Partial("./extensions/angular-loader/Angular Main.cshtml", data: new {
  AngularAppPath = "/angular-demo/angular/browser",
  AngularAppTag = "app-root"
})
Angular Hello World

This will load the Angular app from the specified path (e.g. /angular-demo/angular/browser) regardless of the current edition. For example the hello world app of the Angular Quickstart Guide.

Angular Loader Parameters

var angularConfig = new
{
  // the path to your angular app - this should be the path where the index.html of your angular app is located, relative to the root of your 2sxc app
  AngularAppPath = "relative/path/to/angular/app",
  // usually something like "app-root"
  AngularAppTag = "your-app-root-tag",
  // different editions of your angular app, e.g. live, staging, local - this will be used to switch between compiled and dev code
  // you can leave this empty if you don't need
  Editions = "live,staging,local",
  // the path to your local dev server where angular is running in development mode (usually something like http://localhost:4200)
  LocalDevServerPath = "//localhost:4200",
  // the list of files that angular generates in development mode - you can find these in the index.html that angular generates when running in dev mode
  // depending on your angular configuration, this could be different - make sure to adjust this to your needs
  LocalDevFiles = "runtime.js,polyfills.js,styles.js,vendor.js,main.js"
};

History

  1. v01.00 - Initial release for 2sxc 2026-03

Shortlink: https://go.2sxc.org/ext-ngloader