-
Notifications
You must be signed in to change notification settings - Fork 28
Angular2 Directive
XDex edited this page Aug 2, 2017
·
3 revisions
Angular2 Directive extension for at.js library provides a "flicker-free" implementation of an mbox Target directive, to be used in Angular2 components.
- AT.js library
- Angular2 app
- Include at.js in your
.angular-cli.json'sscriptsconfiguration array; - Install the extension from NPM:
npm install @adobe/target-ng-module -P; - Import Target directive and service in your AppModule:
import ...
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// Specify Target library as an import
TargetModule
],
...- Once the library is imported, you can use Target mbox directive in your Angular application:
// Specify Target options in your app.component.ts
@Component({
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
</div>These extensions are provided free to developers as a starting point to integrate at.js with their Single Page Application. Extensions are not always updated for the latest at.js version. Customization may be required to integrate successfully with your single page app.
Issues: place send feedback and questions through Github issues. We will respond as best we can. Please note, these extensions are not supported by Adobe Client Care or Target Engineering.