To install this library, run:

Usage no npm install needed!

<script type="module">
  import adobeTargetNgModule from 'https://cdn.skypack.dev/@adobe/target-ng-module';




To install this library, run:

$ npm install @adobe/target-ng-module --save

Consuming Target library module

Install the library and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import the library
import { TargetModule } from '@adobe/target-ng-module';

  declarations: [
  imports: [

    // Specify Target library as an import
  providers: [],
  bootstrap: [AppComponent]
export class AppModule { }

Once the library is imported, you can use Target mbox directive in your Angular application:

// Specify Target options in your app.component.ts
  selector: 'app-root',
  templateUrl: './app.component.html'
export class AppComponent {
  targetOpts = {
    mbox: 'simpleDirective'
<!-- You can now use Target mbox directive in app.component.html -->
<div [mbox]="targetOpts">
  Default content


The following Target options can be set on the mbox directive:

Key Type Mandatory Description
mbox String Yes mbox name. It is mandatory if you want to track clicks. If not provided, an error will be logged and tracking event won't be attached.
params Object No mbox parameters - an object of key-value pairs.
timeout Number No timeout in milliseconds. If not specified, default adobe.target will be used.


To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build

To lint all *.ts files:

$ npm run lint

To publish built package, login to NPM and then publish with:

$ npm publish dist


Apache-2.0 © Adobe Systems Inc.