How to use the angular.noop function in angular

To help you get started, we’ve selected a few angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ovh / manager / packages / manager / sms / src / phonebooks / telecom-sms-phonebooks.controller.js View on Github external
deleteSelectedPhonebookContact() {
    const contacts = this.getSelection();
    const queries = contacts.map(contact => this.api.sms.phonebookContact.delete({
      serviceName: this.$stateParams.serviceName,
      bookKey: get(this.phonebooks.current, 'bookKey'),
      id: contact.id,
    }).$promise);
    this.phonebookContact.isDeleting = true;
    queries.push(this.$timeout(angular.noop, 500)); // avoid clipping
    this.TucToast.info(this.$translate.instant('sms_phonebooks_phonebook_contact_selected_delete_info'));
    return this.$q.all(queries).then(() => {
      this.phonebookContact.selected = {};
      return this.refresh();
    }).catch((err) => {
      this.TucToast.error(this.$translate.instant('sms_phonebooks_phonebook_contact_selected_delete_ko', { error: get(err, 'data.message') }));
      return this.$q.reject(err);
    }).finally(() => {
      this.phonebookContact.isDeleting = false;
    });
  }
github ovh / manager / packages / manager / modules / sms / src / sms / users / change-password / telecom-sms-users-change-password.controller.js View on Github external
changePassword() {
    this.loading.changePasswordUser = true;
    return this.$q
      .all([
        this.api.sms.users.edit(
          {
            serviceName: this.$stateParams.serviceName,
            login: this.user.login,
          },
          pick(this.model.user, this.attributes),
        ).$promise,
        this.$timeout(angular.noop, 1000),
      ])
      .then(() => {
        this.loading.changePasswordUser = false;
        this.changed = true;
        return this.$timeout(() => this.close(), 1000);
      })
      .catch((error) =>
        this.cancel({
          type: 'API',
          msg: error,
        }),
      );
  }
github CSCfi / exam / app / frontend / src / enrolment / finished / collaborativeExamParticipations.component.ts View on Github external
$onInit() {
            this.filter = { ordering: '-ended', text: '' };
            this.CollaborativeExam.listStudentParticipations().then((participations: Participation[]) => {
                this.originals = Array.from(participations);
                this.participations = Array.from(participations);
            }).catch(angular.noop);
        }
github spinnaker / deck / app / scripts / modules / core / src / widgets / scopeClusterSelector.directive.js View on Github external
controller: function controller() {
      const vm = this;

      vm.toggled = vm.toggled || angular.noop;
      vm.onChange = vm.onChange || angular.noop;
      vm.required = vm.required || false;

      const selectedNotInClusterList = () => {
        return !(
          angular.isArray(vm.clusters) &&
          vm.clusters.length &&
          vm.clusters.some(cluster => cluster === vm.model)
        );
      };

      const modelIsSet = () => {
        return vm.model !== undefined || vm.model !== null || vm.model.trim() !== '';
      };

      vm.clusterChanged = function() {
        vm.onChange({ clusterName: vm.model });
github davinkevin / AngularStompDK / core / service.spec.js View on Github external
describe('Service', () => {

    let settings = {
        "url": "http://connection.com/url",
        "login": "login",
        "password": "password",
        "class": angular.noop,
        "debug": true,
        "vhost": "vhost",
        "timeOut" : 5000,
        "heartbeat": {
            "outgoing": 1,
            "incoming": 2
        },
        "autoConnect" : true
    };

    let Stomp = { client : x => x, over : x => x},
        $q = { defer : x => x, reject : x => x },
        promise = { then : func => func() },
        defered = { promise : promise, resolve : angular.noop, reject : angular.noop},
        aConnection = { unsubscribe : angular.noop },
        stompClient = { connect : x => x, heartbeat : {}, subscribe : () => aConnection, send : angular.noop, disconnect : func => func() },
github ovh / manager / packages / manager / modules / sms / src / sms / phonebooks / contact-update / telecom-sms-phonebooks-phonebook-contact-update.controller.js View on Github external
update() {
    this.phonecontactForm.isUpdating = true;
    return this.$q
      .all([
        this.api.sms.phonebooks.phonebookContact.update(
          {
            serviceName: this.$stateParams.serviceName,
            bookKey: get(this.phonebook, 'bookKey'),
            id: get(this.contact, 'id'),
          },
          this.TucPhonebookcontact.getContactData(this.phonecontactForm),
        ).$promise,
        this.$timeout(angular.noop, 1000),
      ])
      .then(() => {
        this.phonecontactForm.isUpdating = false;
        this.phonecontactForm.hasBeenUpdated = true;
        return this.$timeout(() => this.close(), 1500);
      })
      .catch((error) =>
        this.cancel({
          type: 'API',
          msg: error,
        }),
      );
  }
github spinnaker / deck / app / scripts / modules / core / deploymentStrategy / strategies / custom / custom.strategy.module.js View on Github external
.config(function(deploymentStrategyConfigProvider) {
    if (SETTINGS.feature.pipelines !== false) {
      deploymentStrategyConfigProvider.registerStrategy({
        label: 'Custom',
        description: 'Runs a custom deployment strategy',
        key: 'custom',
        providers: ['aws', 'gce', 'titus', 'kubernetes', 'appengine'],
        additionalFields: [],
        additionalFieldsTemplateUrl: require('./additionalFields.html'),
        initializationMethod: angular.noop,
      });
    }

  });
github spinnaker / deck / app / scripts / modules / amazon / serverGroup / details / resize / resizeCapacity.directive.js View on Github external
.directive('awsResizeCapacity', function () {
    return {
      restrict: 'E',
      templateUrl: require('./resizeCapacity.directive.html'),
      scope: {},
      bindToController: {
        command: '=',
        currentSize: '='
      },
      controllerAs: 'vm',
      controller: angular.noop,
    };
  });
github spinnaker / deck / app / scripts / modules / amazon / serverGroup / configure / wizard / capacity / capacityFooter.directive.js View on Github external
return {
      restrict: 'E',
      templateUrl: require('./capacityFooter.directive.html'),
      scope: {},
      bindToController: {
        command: '=',
        wizard: '=',
        form: '=',
        taskMonitor: '=',
        cancel: '&',
        isValid: '&',
        showSubmitButton: '&',
        submit: '&'
      },
      controllerAs: 'vm',
      controller: angular.noop,
    };
  });