Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
AngularJS

Custom Components in AngularJS

Use .component() (1.5+) for cleaner component-style directives.

Custom Components in AngularJS — a practical guide to AngularJS custom components with clear examples you can reuse in real projects.

AngularJS Tutorial Series (84/99). Prefer one article? Read the complete AngularJS tutorial.

Short description

Components default to isolate scope and controller-as $ctrl.

component()

angular.module('myApp').component('userCard', {
  bindings: { user: '<' },
  templateUrl: 'views/user-card.html',
  controller: function () {
    var $ctrl = this;
  }
});

Leave a reply

Your email address will not be published. Required fields are marked *