Nominating Presidential Muppets

npm

Check out our latest tech talk, "JavaScript Supply Chain Security" presented by VP of Security, Adam Baldwin.Watch it here »

@2sic.com/dnn-sxc-angular

6.0.5 • Public • Published

dnn-sxc-angular

Connector for angular 4.3+ (git | web) if you're using

  1. the open source platform DNN 7+ (git | web)
  2. and/or the open source CMS 2sxc 7+ (git | web)

This is a helper system which

  1. automatically provides all important dnn-parameters (module ID, security token, etc.) to angular
  2. adds an Http Interceptor for the HttpClient which automatically applies these parameters to all requests
  3. prevents the enter-key from causing DNN form submits (you can override this)

It uses observables to make it happen, thereby avoiding timing / async problems common in this scenario.

How to get this package

It's published on npm, so the most common way is to get it using npm:

  • npm install "@2sic.com/dnn-sxc-angular" --save

How To Use

Setup

Follow the quickstart guide to start using dnn-sxc-angular.

Using WebAPIs inside DNN

This will now work automatically, because all headers etc. are now automatically added by the system.

Using 2sxc Content-Items, Queries and APIs

This package contains a Data object, which provides 3 observable streams

  • content$
  • query$
  • api$

To use them, best check out the demo app or simply work through TypeScript intelisense - we documented all the commands.

Getting ModuleId, TabId, etc. and the sxc Instance

There is a Context object which provides these properties as streams (observables). Just inject Context and access it from there. Note that you almost never need this, as the HttpClient is already configured and ready to go, including the headers it needs.

  • moduleId$
  • tabId$
  • sxc$
  • etc. (there are about 3 more...)

Internal Notes

Todo

  • create & test simple app-api access
  • enhance the content-manager to provide write commands (ATM read-only)

Keywords

none

install

npm i @2sic.com/dnn-sxc-angular

Downloadsweekly downloads

35

version

6.0.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability