Integrate an Angular library into a non-angular app
NickName:Sébastien Tromp Ask DateTime:2019-10-09T19:53:53

Integrate an Angular library into a non-angular app

My scenario is as follows:

  • I have built an Angular library that exposes a service, whose dependencies are passed in the constructor
  • I have a separate AWS Lambda function (triggers on cron) that would need to use this service.

My question is: is there a way to bundle the library so that the service can be easily instantiated in the non-angular app, and avoid having to construct the dependency graph manually?

Ideally, from the lambda function I would just call something like

const service = MyAngularService.instance();
service.doStuff();

Is it at all possible?

Similar to: Using Angular Library in Non-Angular App

Copyright Notice:Content Author:「Sébastien Tromp」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/58303559/integrate-an-angular-library-into-a-non-angular-app

More about “Integrate an Angular library into a non-angular app” related questions

Integrate an Angular library into a non-angular app

My scenario is as follows: I have built an Angular library that exposes a service, whose dependencies are passed in the constructor I have a separate AWS Lambda function (triggers on cron) that wo...

Show Detail

Create a Non-Angular library in an Angular application

I need to develop a typescript library in my Angular project and publish it to npm later. I learned that in Angular 6 I could use ng generate library to generate an npm ready library and be able to...

Show Detail

testing non-angular app with protractor and webdriver fundamentals

I am writing e2e tests for a non-angular app using protractor and while there is quite a bit of information on how to accomplish this, it seems there are many different ways and so I have some

Show Detail

Using Angular 2 components throughout a non-Angular app

I have a fork of a preexisting, mature, non-Angular web app. I also have some existing Angular 2 components from a separate app that I wish to reuse. I would like to sprinkle the existing Angular

Show Detail

Sync Protractor with an Angular app hosted inside an iframe by a non-Angular website

I'm having trouble accessing elements via methods such as by.binding(). The project setup is as follows: Non-angular website | --> Iframe | --> Angular app Here's a snippet of what

Show Detail

JHipster non-angular landing page

I want to use plain html views in a JHipster project as a landing page. Is there a best practice for a Spring-Boot controller? My goal is to use a non-angular html page for the path "/". The angular-

Show Detail

Protractor throwing exception in synchronization between angular and non-angular

We are developing a protractor jasmine framework for testing the angular part of our application. When we run the script the protractor switches from non-angular to angular without any problem, how...

Show Detail

Protractor: Testing non-Angular App in an Iframe

I'm writing e2e tests for my non-angular app, using protractor Version 3.3.0. My app loads another non-Angular App inside an iframe, and i'm trying to write tests to the iframed-in with Protractor....

Show Detail

Angular to Non-Angular pages breaks history, clicking back brings us to app base href

We're migrating some of our website to an angular app. We're implementing the paths so that they match the old URL structure so we don't break links and don't have to redirect. Using Angular 6 Wh...

Show Detail

Alternativa to Protractor for NON-angular project

I need to find the best testing tool for automation of front end in NON-angular project. I was told that Protractor has a bad performance for non-angular testing and was advised to use Puppeteer. H...

Show Detail