How to use the angular.module 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 / modules / pci / src / projects / project / ssh-keys / add / add.module.js View on Github external
import angular from 'angular';

import '@ovh-ux/manager-core';
import '@ovh-ux/ng-ovh-api-wrappers'; // should be a peer dependency of ovh-api-services
import 'angular-translate';
import 'ovh-api-services';
import 'ovh-ui-angular';

import routing from './add.routing';

const moduleName = 'ovhManagerPciProjectSshKeysAdd';

angular
  .module(moduleName, [
    'oui',
    'ovhManagerCore',
    'ovh-api-services',
    'pascalprecht.translate',
  ])
  .config(routing)
  .run(/* @ngTranslationsInject:json ./translations */);

export default moduleName;
github JetBrains / ring-ui / components / select-ng / select-ng.examples.js View on Github external
export const lazyLoadingOnScroll = () => {
  angular.module(APP_NAME, [SelectNG]).controller('testCtrl', function ctrl($q, $timeout) {
    const PAGE_SIZE = 20;

    // Result array is increasing after each method call
    this.getOptions = (skip, query) => {
      action('getOptions')('query = ', query, 'skip = ', skip);
      const arr = [];
      if (skip < 50) {
        for (let i = 0; i < PAGE_SIZE; ++i) {
          let labelText = `${skip}-${i}`;
          if (query) {
            labelText = `${query} ${labelText}`;
          }
          arr.push(labelText);
        }
        if (skip === 0) {
          arr.unshift('Unexpected option at the beginning');
github tarlepp / angular-material-webpack-seed / src / blocks / router / router.module.js View on Github external
// Imports
import angular from 'angular';
import RouterHelper from './routerHelper.provider';

/**
 * @desc  Module initialize.
 *
 * @ngInject
 */
export default angular
  .module('blocks.router', [])
  .provider('RouterHelper', RouterHelper)
  .name;
github filipkis / endev / src / providers / rest.js View on Github external
var angular = require('angular');
var utils = require('./../utils.js')
var X2JS = require("x2js");
var generalDataFilter = require('./helpers/generalDataFilter.js');

angular.module('Endev').service("$endevRest", ['$http','$interpolate','$q', function($http,$interpolate,$q){

  function prependTransform(defaults, transform) {
    // We can't guarantee that the transform transformation is an array
    transform = angular.isArray(transform) ? transform : [transform];
    // Append the new transformation to the defaults
    return transform.concat(defaults);
  }

  return {
    query: function(attrs,extra,callback) {
      var from = attrs.from.slice(attrs.from.indexOf(":")+1);
      var result = $q.defer();
      if(attrs.parentLabel) {
        var tmp = utils.valueOnPath(attrs.parentObject, from, true);
        tmp = generalDataFilter(tmp,attrs);
        if(callback && angular.isFunction(callback)) callback(tmp)
github Urigo / meteor-angular-socially / imports / ui / components / password / password.ts View on Github external
reset() {
    Accounts.forgotPassword(this.credentials, this.$bindToContext((err) => {
      if (err) {
        this.error = err;
      } else {
        this.$state.go('parties');
      }
    }));
  }
}

const name = 'password';

// create a module
export const PasswordNg1Module = angular.module(name, [
  angularMeteor,
  uiRouter
]);

export function registerPassword() {
  PasswordNg1Module
    .component(name, {
      template,
      controllerAs: name,
      controller: Register
    })
    .config(config);
}

function config($stateProvider) {
  'ngInject';
github flow-typed / flow-typed / definitions / npm / angular_v1.4.7 / flow_v0.47.x-v0.70.x / test_angular_v1.4.7.js View on Github external
it("can be declared to any value", () => {
    angular.module("foo", []).value("foo", 123);
    angular.module("foo", []).value("foo", "str");
    angular.module("foo", []).value("foo", {});
  });
});
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / feeds / edit-feed / profile-history / profile-stats.ts View on Github external
};
        const promise = this.$http.get(this.RestUrlService.FEED_PROFILE_STATS_URL(this.model.id), {params: {'processingdttm': this.processingdttm}});
        promise.then(successFn, errorFn);
        return promise;
    };


    $onInit() {
        this.processingDate = new Date(this.HiveService.getUTCTime(this.processingdttm));
        this.getProfileStats();
    }
}

angular.module(moduleName).controller('FeedProfileStatsController',
    ["$http", "FeedService", "RestUrlService", "HiveService", "BroadcastService", FeedProfileStatsController]);
angular.module(moduleName).directive('thinkbigFeedProfileStats', directive);
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / features / playlist / playlist_routes.ts View on Github external
templateUrl: 'public/app/features/playlist/partials/playlist.html',
      controllerAs: 'ctrl',
      controller: 'PlaylistEditCtrl',
    })
    .when('/playlists/play/:id', {
      template: '',
      resolve: {
        init: (playlistSrv, $route) => {
          const playlistId = $route.current.params.id;
          playlistSrv.start(playlistId);
        },
      },
    });
}

angular.module('grafana.routes').config(grafanaRoutes);
github mhalle / oabrowser / ng-directives / sceneCrosshairDirective.js View on Github external
const angular = require('angular');
const throttle = require('throttle-debounce').throttle;
const THREE = require('three');

angular.module('atlasDemo').directive( 'sceneCrosshair', [function () {
    return {
        restrict: 'EA',
        scope: {},
        templateUrl : 'ng-templates/sceneCrosshair.html',
        controller: ['$scope', '$element', 'mainApp', 'firebaseView', function ( $scope, $element, mainApp, firebaseView) {

            $scope.style = {
                stroke : "white",
                display : "none",
                top : "0px",
                left : "0px"
            };


            var canvas = $('#rendererFrame canvas'),
                debouncedCommit = throttle(150, function () {
github simpulton / eggly-redux / client / app / components / categories / bookmarks / save / save.js View on Github external
import saveComponent from './save.component';

const config = ($stateProvider) => {
  'ngInject';
  $stateProvider
    .state('eggly.categories.bookmarks.create', {
      url: '/bookmarks/create',
      template: ''
    })
    .state('eggly.categories.bookmarks.edit', {
      url: '/bookmarks/:bookmarkId/edit',
      template: ''
    });
};

let saveModule = angular.module('save', [
    uiRouter
  ])
  .config(config)
  .component('save', saveComponent);

export default saveModule;