Getting Started

20 Jul 20172 minutes to read

This section explains briefly about how to integrate a Barcode control in your application with Angular.

Script and CSS Reference

Create a HTML page and add the scripts and CSS references in the order mentioned in the following code example.

  • HTML
  • <!DOCTYPE html>
            <link href="//" rel="stylesheet" />
            <script src="node_modules/core-js/client/shim.min.js"></script>
            <script src="node_modules/zone.js/dist/zone.js"></script>
            <script src="node_modules/reflect-metadata/Reflect.js"></script>
            <script src="node_modules/systemjs/dist/system.src.js"></script>
            <script src=""></script>
            <script src="" type="text/javascript"></script>
            <script src=""></script>
            <script src="" type="text/javascript"></script>
            <script src =""></script>
            <script src="systemjs.config.js"></script>

    In the above code, ej.web.all.min.jsscript reference has been added for demonstration purpose. It is not recommended to use it during deployment, as it contains all the widgets, which results in deploying large script file. Instead, you can use[CSG]( “”) utility to generate a custom script file with the required widgets for deployment purpose.

    Initialize and configure the control

    The code example for defining Barcode control in Angular is as follows,

  • HTML
  • <ej-barcode text="" id="barcode1" xDimension="8">
  • TS
  • import { Component } from '@angular/core';
      selector: 'ej-app',
      templateUrl: 'app/components/barcode/default.component.html'
    export class DefaultComponent {
      constructor(public northwindService: NorthwindService) { }

    The above code will produce the Barcode as shown in the below figure.