How to use the angular.element 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 ngOfficeUIFabric / ng-officeuifabric / src / components / persona / personaDirective.spec.ts View on Github external
it('should have CSS for size', () => {
        let personas: angular.IAugmentedJQuery[] = [
          angular.element(''),
          angular.element(''),
          angular.element(''),
          angular.element(''),
          angular.element('')
        ];

        let expectedClass: string[] = ['ms-Persona--tiny', 'ms-Persona--xs', 'ms-Persona--sm', 'ms-Persona--lg', 'ms-Persona--xl'];

        for (let i: number = 0; i < personas.length; i++) {
          _compile(personas[i])(scope);
        }
        scope.$digest();

        let persona: JQuery;
        // let innerDiv: JQuery;

        for (let i: number = 0; i < personas.length; i++) {
          persona = jQuery(personas[i]);
          // innerDiv = persona.find('div.ms-Persona');
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / services / fattable / FattableService.ts View on Github external
self.table.W = columnOffset[columnOffset.length - 1];
            self.table.setup();

            // console.log('displaying cells', scrolledCellX, scrolledCellY);
            self.table.scroll.setScrollXY(x, y); //table.setup() scrolls to 0,0, here we scroll back to were we were while resizing column
        }

        const eventId = "resize.fattable." + settings.tableContainerId;
        angular.element($window).unbind(eventId);
        const debounced = _.debounce(self.setupTable, settings.setupRefreshDebounce);
        angular.element($window).on(eventId, function () {

            debounced(settings);
        });

        angular.element(selector).on('$destroy', function () {

            angular.element($window).unbind(eventId);
        });
    }
github indrimuska / angular-moment-picker / tests / elementCreation.ts View on Github external
it('should transclude INPUT content', () => {
		let $element = test.buildTemplate('input', { class: 'my-content' });
		
		expect($element.length).toEqual(1);
		expect(angular.element($element[0]).hasClass('my-content')).toBe(true);
	});
});
github elastic / kibana / src / ui / public / directives / __tests__ / validate_query.js View on Github external
var compile = function () {
  $rootScope.mockModel = 'cycle' + cycleIndex++;
  $rootScope.mockQueryInput = undefined;

  $elem = angular.element(markup);
  $compile($elem)($rootScope);
  $elemScope = $elem.isolateScope();
  $rootScope.$digest();
};
github mattlewis92 / angular-bootstrap-confirm / test / angular-bootstrap-confirm.spec.js View on Github external
function createPopover(htmlString) {
      element = angular.element(htmlString);
      $compile(element)(scope);
      scope.$apply();
      return $('body').find('.popover:first');
    }
github ngOfficeUIFabric / ng-officeuifabric / src / components / searchbox / searchboxDirective.spec.ts View on Github external
it('when cleared, $dirty should be set', inject(($rootScope: angular.IRootScopeService, $compile: Function) => {
    let $newScope: any = $rootScope.$new();
    $newScope.value = 'Value';

    let tag: JQuery = angular.element('');
    $compile(tag)($newScope);
    $newScope.$digest();
    tag = jQuery(tag[0]);

    let ngModel: angular.INgModelController = angular.element(tag).controller('ngModel');
    expect(ngModel.$dirty).toBe(false);

    let input: JQuery = tag.find('.ms-SearchBox-field');
    let button: JQuery = tag.find('.ms-SearchBox-closeButton');

    angular.element(button).triggerHandler('mousedown');
    angular.element(input).triggerHandler('blur');

    $newScope.$digest();

    expect($newScope.value).toBe('');
    expect(ngModel.$dirty).toBe(true);
  }));
});
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / feeds / edit-feed / profile-history / profile-history.ts View on Github external
public showProfileDialog(currentTab: any, profileRow: any) {

        this.$mdDialog.show({
            controller: 'FeedProfileItemController',
            templateUrl: 'js/feed-mgr/feeds/edit-feed/profile-history/profile-history-dialog.html',
            parent: angular.element(document.body),
            clickOutsideToClose: false,
            fullscreen: true,
            locals: {
                feed: this.model,
                profileRow: profileRow,
                currentTab: currentTab
            }
        }).then((msg: any) => {
        }, () => {
        });
    };
}
github grafana / grafana / public / app / core / services / dynamic_directive_srv.ts View on Github external
addDirective(element: any, name: string, scope: any) {
    const child = angular.element(document.createElement(name));
    this.$compile(child)(scope);

    element.empty();
    element.append(child);
  }
github benmarch / angular-ui-tour / app / tour-step-service.js View on Github external
function createPopup(step, tour) {
        const scope = angular.extend($rootScope.$new(), {
                tourStep: step,
                tour: tour
            }),
            popup = $compile($templateCache.get('tour-step-popup.html'))(scope),
            parent = step.config('appendToBody') ? angular.element($document[0].body) : step.element.parent();

        parent.append(popup);
        return popup;
    }
github spinnaker / deck / app / scripts / modules / core / modal / wizard / wizardSubFormValidation.service.spec.js View on Github external
beforeEach(function () {
      scope = $rootScope.$new();
      let formName = 'myTopLevelForm';
      let subFormName = 'mySubForm';

      wizardSubFormValidation.config({scope: scope, form: formName});

      let element = angular.element(
        `<form name="${formName}">
             
               <input required="" name="myInput">
             
           </form>`);

      $compile(element)(scope);

      form = scope.myTopLevelForm;
    });