• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript angular.element函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中angular.element函数的典型用法代码示例。如果您正苦于以下问题:TypeScript element函数的具体用法?TypeScript element怎么用?TypeScript element使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了element函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: it

        it('should have proper CSS class for presence', () => {
          let personaCards: angular.IAugmentedJQuery[] = [
            angular.element('<uif-persona-card uif-presence="available"></uif-persona-card>'),
            angular.element('<uif-persona-card uif-presence="away"></uif-persona-card>'),
            angular.element('<uif-persona-card uif-presence="blocked"></uif-persona-card>'),
            angular.element('<uif-persona-card uif-presence="busy"></uif-persona-card>'),
            angular.element('<uif-persona-card uif-presence="dnd"></uif-persona-card>'),
            angular.element('<uif-persona-card uif-presence="offline"></uif-persona-card>')
          ];

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

          scope.$digest();

          let expectedClasses: string[] = [
            'ms-Persona--available',
            'ms-Persona--away',
            'ms-Persona--blocked',
            'ms-Persona--busy',
            'ms-Persona--dnd',
            'ms-Persona--offline'
          ];

          let personaCard: JQuery;

          for (let i: number = 0; i < personaCards.length; i++) {
            personaCard = jQuery(personaCards[i]);

            let personaDiv: JQuery = personaCard.find('div.ms-Persona');
            expect(personaDiv.length === 1).toBeTruthy();
            expect(personaDiv).toHaveClass(expectedClasses[i]);
          }

        });
开发者ID:jigargandhi,项目名称:ng-officeuifabric,代码行数:36,代码来源:personacardDirective.spec.ts


示例2: beforeEach

        beforeEach(angularMocks.inject(function ($rootScope, $compile) {
          var ctrl: any = {
            colorSchemes: [
              {name: 'Oranges',   value: 'interpolateOranges',  invert: 'dark'},
              {name: 'Reds',      value: 'interpolateReds',     invert: 'dark'},
            ],
            events: new Emitter(),
            height: 200,
            panel: {
              heatmap: {
              },
              cards: {
                cardPadding: null,
                cardRound: null
              },
              color: {
                mode: 'spectrum',
                cardColor: '#b4ff00',
                colorScale: 'linear',
                exponent: 0.5,
                colorScheme: 'interpolateOranges',
                fillBackground: false
              },
              xBucketSize: 1000,
              xBucketNumber: null,
              yBucketSize: 1,
              yBucketNumber: null,
              xAxis: {
                show: true
              },
              yAxis: {
                show: true,
                format: 'short',
                decimals: null,
                logBase: 1,
                splitFactor: null,
                min: null,
                max: null,
                removeZeroValues: false
              },
              tooltip: {
                show: true,
                seriesStat: false,
                showHistogram: false
              },
              highlightCards: true
            },
            renderingCompleted: sinon.spy(),
            hiddenSeries: {},
            dashboard: {
              getTimezone: sinon.stub().returns('utc')
            },
            range: {
              from: moment.utc("01 Mar 2017 10:00:00"),
              to: moment.utc("01 Mar 2017 11:00:00"),
            },
          };

          var scope = $rootScope.$new();
          scope.ctrl = ctrl;

          ctx.series = [];
          ctx.series.push(new TimeSeries({
            datapoints: [[1, 1422774000000], [2, 1422774060000]],
            alias: 'series1'
          }));
          ctx.series.push(new TimeSeries({
            datapoints: [[2, 1422774000000], [3, 1422774060000]],
            alias: 'series2'
          }));

          ctx.data = {
            heatmapStats: {
              min: 1,
              max: 3,
              minLog: 1
            },
            xBucketSize: ctrl.panel.xBucketSize,
            yBucketSize: ctrl.panel.yBucketSize
          };

          setupFunc(ctrl, ctx);

          let logBase = ctrl.panel.yAxis.logBase;
          let bucketsData = convertToHeatMap(ctx.series, ctx.data.yBucketSize, ctx.data.xBucketSize, logBase);
          ctx.data.buckets = bucketsData;

          // console.log("bucketsData", bucketsData);
          // console.log("series", ctrl.panel.yAxis.logBase, ctx.series.length);

          let elemHtml = `
          <div class="heatmap-wrapper">
            <div class="heatmap-canvas-wrapper">
              <div class="heatmap-panel" style='width:${elementWidth}px'></div>
            </div>
          </div>`;

          var element = angular.element(elemHtml);
          $compile(element)(scope);
          scope.$digest();
//.........这里部分代码省略.........
开发者ID:martinwalsh,项目名称:grafana,代码行数:101,代码来源:renderer_specs.ts


示例3:

import * as angular from "angular";
import {
    HelloComponent
} from "./hello/hello.component";

angular.module("ng-ts-starterkit", [])
    .component(HelloComponent.selector, HelloComponent);

angular.element(document).ready(function () {
    angular.bootstrap(document, ["ng-ts-starterkit"]);
});
开发者ID:kaflan,项目名称:angular-typescript-starter-kit,代码行数:11,代码来源:app.ts


示例4: beforeEach

        beforeEach(angularMocks.inject(function($rootScope, $compile) {
          var ctrl: any = {
            events: new Emitter(),
            height: 200,
            panel: {
              legend: {},
              grid: { },
              yaxes: [
                {
                  min: null,
                  max: null,
                  format: 'short',
                  logBase: 1
                },
                {
                  min: null,
                  max: null,
                  format: 'short',
                  logBase: 1
                }
              ],
              thresholds: [],
              xaxis: {},
              seriesOverrides: [],
              tooltip: {
                shared: true
              }
            },
            renderingCompleted: sinon.spy(),
            hiddenSeries: {},
            dashboard: {
              getTimezone: sinon.stub().returns('browser')
            },
            range: {
              from: moment([2015, 1, 1, 10]),
              to: moment([2015, 1, 1, 22]),
            },
          };

          var scope = $rootScope.$new();
          scope.ctrl = ctrl;


          $rootScope.onAppEvent = sinon.spy();

          ctx.data = [];
          ctx.data.push(new TimeSeries({
            datapoints: [[1,1],[2,2]],
            alias: 'series1'
          }));
          ctx.data.push(new TimeSeries({
            datapoints: [[1,1],[2,2]],
            alias: 'series2'
          }));

          setupFunc(ctrl, ctx.data);

          var element = angular.element("<div style='width:" + elementWidth + "px' grafana-graph><div>");
          $compile(element)(scope);
          scope.$digest();

          $.plot = ctx.plotSpy = sinon.spy();
          ctrl.events.emit('render', ctx.data);
          ctx.plotData = ctx.plotSpy.getCall(0).args[1];
          ctx.plotOptions = ctx.plotSpy.getCall(0).args[2];
        }));
开发者ID:casaria,项目名称:grafana-trillium-src-fork,代码行数:66,代码来源:graph_specs.ts


示例5: function

  'validation.match',
  navbar,
  footer,
  main,
  constants,
  socket,
  util,
  lists,
  list
])
  .config(routeConfig)
  .run(function($rootScope, $location, Auth) {
    'ngInject';
    // Redirect to login if route requires auth and you're not logged in
    $rootScope.$on('$stateChangeStart', function(event, next) {
      Auth.isLoggedIn(function(loggedIn) {
        if(next.authenticate && !loggedIn) {
          $location.path('/login');
        }
      });
    });
  });

angular
  .element(document)
  .ready(() => {
    angular.bootstrap(document, ['myappApp'], {
      strictDi: true
    });
  });
开发者ID:georgianamoldovan,项目名称:webappno1,代码行数:30,代码来源:app.ts


示例6: function

 $scope.$on('$destroy', function() {
   angular.element(window).unbind('resize');
   $scope.dashboard.destroy();
 });
开发者ID:connection-reset,项目名称:grafana,代码行数:4,代码来源:dashboard_ctrl.ts


示例7: inject

 inject(($compile: Function, $rootScope: angular.IRootScopeService) => {
   element = angular.element('<uif-list><uif-list-item></uif-list-item></uif-list>');
   $compile(element)(scope);
   scope.$digest();
   expect(element.children().eq(0).children().eq(0).children().eq(0)).toHaveClass('ms-ListItem');
 }));
开发者ID:sjclemmy,项目名称:ng-officeuifabric,代码行数:6,代码来源:listDirective.spec.ts


示例8: beforeEach

    beforeEach(inject(($rootScope: angular.IRootScopeService, $compile: Function, $q: angular.IQService) => {
      $element = angular.element(`
       <uif-people-picker
         uif-people="onSearch"
         ng-model="selectedPeople"
         placeholder="Search for people"
         uif-selected-person-click="personClicked">
          <uif-people-search-more uif-disconnected="!connected">
            <uif-secondary-text>Showing {{sourcePeople.length}} results</uif-secondary-text>
            <uif-primary-text uif-search-for-text="You are searching for: ">Search organization people</uif-primary-text>
            <uif-disconnected-text>
              We are having trouble connecting to the server.
              <br> Please try again in a few minutes.</uif-disconnected-text>
          </uif-people-search-more>
        </uif-people-picker>`);

      $scope = $rootScope;
      $scope.connected = false;
      let defaultGroup: any = {
        name: 'default', order: 1
      };

      $scope.people = [{
        additionalData: [
          {
            color: 'magenta',
            group: defaultGroup,
            icon: 'Persona.Person2.png',
            presence: 'available',
            primaryText: 'Joseph Pena',
            secondaryText: 'Contoso Inc.'
          }
        ],
        color: 'magenta',
        group: defaultGroup,
        icon: 'Persona.Person2.png',
        presence: 'available',
        primaryText: 'Russel Miller',
        secondaryText: 'Sales'
      },
        {
          color: 'magenta',
          group: defaultGroup,
          icon: 'Persona.Person2.png',
          presence: 'available',
          primaryText: 'Russel Miller',
          secondaryText: 'Sales'
        }];

      $scope.onSearch = (query) => {
        if (!query) {
          return $scope.people;
        }
        let deferred: angular.IDeferred<any> = $q.defer();

        deferred.resolve([$scope.people[1]]);

        return deferred.promise;
      };
      $compile($element)($scope);
      $element = jQuery($element[0]);
      $scope.$apply();
    }));
开发者ID:sjclemmy,项目名称:ng-officeuifabric,代码行数:63,代码来源:peoplePickerDirective.spec.ts


示例9: it

 it('should render the table header using a span tag', inject(($compile: Function, $rootScope: ng.IRootScopeService) => {
     element = ng.element('<uif-table><uif-table-row><uif-table-header></uif-table-header></uif-table-row></uif-table>');
     $compile(element)(scope);
     scope.$digest();
     expect(element.children().eq(0).children().eq(0).prop('tagName')).toEqual('SPAN');
 }));
开发者ID:dimkk,项目名称:ng-officeuifabric,代码行数:6,代码来源:tableDirective.spec.ts



注:本文中的angular.element函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript angular.equals函数代码示例发布时间:2022-05-28
下一篇:
TypeScript angular.copy函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap