Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

afspawnservice

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

afspawnservice - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "afspawnservice",
"version": "1.0.4",
"version": "1.0.5",
"description": "This is an Angular service that allows you to spawn components on-the-fly, with a service call. For more details, watch my talk here: https://www.youtube.com/watch?v=-Hy-i4q8Vtg&t=38s",

@@ -5,0 +5,0 @@ "main": "main.js",

@@ -35,3 +35,18 @@ # AFSpawnService

####Spawning a component
#### Add to `appModule.entryComponents`
In order to be able to spawn a component like this, you have to tell Angular that this component is an
`entryComponent`. This means that it isn't a child component of any other components. It is a top-level
component. If you don't do this, you can't dynamically create the component with `AFSpawnService`.
Here is how you do this:
```typescript
@NgModule({
... // ▼▼▼ By adding your component to the entryComponents, it is now ready to be spawned dynamically
entryComponents: [ FooComponent ]
...
})
export class AppModule{}
```
#### Spawning a component
First import the component class that you want to spawn, and then call the spawn service, and pass in the class to it.

@@ -38,0 +53,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc