code: function buttonComponent($parse) {
    return {
      require: ['?^ngeoBtnGroup', 'ngModel'],
      restrict: 'A',
      /**
       * @param {angular.IScope} scope Scope.
       * @param {JQuery} element Element.
       * @param {angular.IAttributes} attrs Attributes.
       * @param {angular.IController|undefined} ctrls Controller.
       */
      link: (scope, element, attrs, ctrls) => {
        if (!ctrls) {
          throw new Error('Missing ctrls');
        }
        const buttonsCtrl = ctrls[0];
        const ngModelCtrl = ctrls[1];
        let indexInGroup = -1;
  
        const ngModelGet = $parse(attrs['ngModel']);
        const ngModelSet = ngModelGet.assign;
  
        // Set ng-model value to false if undefined
        if (ngModelGet(scope) === undefined) {
          ngModelSet(scope, false);
        }
        if (buttonsCtrl !== null) {
          indexInGroup = buttonsCtrl.addButton(ngModelGet);
        }
  
        // UI -> model
        element.on('click', () => {
          scope.$apply(() => {
            ngModelCtrl.$setViewValue(!ngModelCtrl.$viewValue);
            ngModelCtrl.$render();
          });
        });
  
        // model -> UI
        ngModelCtrl.$render = function() {
          if (ngModelCtrl.$viewValue && buttonsCtrl !== null) {
            buttonsCtrl.activate(indexInGroup);
          }
          element.toggleClass('active', ngModelCtrl.$viewValue);
        };
      }
    };
  }
docs: The ngeo-btn allows creating toggle buttons working with ng-model. It is
  typically used with Bootstrap buttons (`btn`).
  
  Example:
  
  <button ngeo-btn class="btn" ng-model="ctrl.interaction.active"></button>
  
  This example is about creating a Bootstrap button that can pressed/depressed
  to activate/deactivate an OpenLayers interaction.
  
  @htmlAttribute {*} ng-model Any property on the scope. Ideally a boolean.
  @param {angular.IParseService} $parse Angular parse service.
  @return {angular.IDirective} The directive specs.
  @ngInject
  @ngdoc directive
  @ngname ngeoBtn