當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript of.of函數代碼示例

本文整理匯總了TypeScript中rxjs/internal/observable/of.of函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript of函數的具體用法?TypeScript of怎麽用?TypeScript of使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了of函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: constructor

 constructor() {
     this.rooms = of([{
         id: '1',
         title: 'Star Fox' ,
         picture: '.jpg'
     },
     {
         id: '2',
         title: 'Zelda',
         picture: '.jpg'
     },
     {
         id: '3',
         title: 'Donkey Kong',
         picture: '.jpg'
     },
     {
         id: '4',
         title: 'Sim City',
         picture: '.jpg',
     },
     {
         id: '5',
         title: 'Halo',
         picture: '.jpg',
     }]);
 }
開發者ID:YeseniaEC,項目名稱:gw-reserve,代碼行數:27,代碼來源:room.service.ts

示例2: it

    it('should disabled when just hava the default device', () => {
        spyOn(dotDeviceService, 'get').and.returnValue(of([]));

        fixture.detectChanges();

        const pDropDown: DebugElement = de.query(By.css('p-dropdown'));
        expect(pDropDown.componentInstance.disabled).toBeTruthy();
    });
開發者ID:dotCMS,項目名稱:core-web,代碼行數:8,代碼來源:dot-device-selector.component.spec.ts

示例3: it

    it('should not execute recaptcha when captcha is disabled', () => {
      component.teamName = 'some team';
      component.password = 'some password';

      const captchaResponse: HttpResponse<string> = new HttpResponse({
        body: JSON.stringify({captchaEnabled: false})
      });
      mockTeamService.isCaptchaEnabledForTeam.and.returnValue(of(captchaResponse));

      component.requestCaptchaStateAndLogIn();

      expect(mockTeamService.login).toHaveBeenCalled();
      expect(mockRecaptchaComponent.execute).not.toHaveBeenCalled();
    });
開發者ID:milesjos,項目名稱:retroquest,代碼行數:14,代碼來源:login.page.spec.ts

示例4: it

    it('should set jwt as cookie and navigate to team page when captcha is disabled', () => {
      component.teamName = 'Team Name';
      component.password = 'p4ssw0rd';
      component.confirmPassword = 'p4ssw0rd';

      const teamUrl = 'team/teamId';
      const jwt = 'im.a.jwt';
      const createTeamResponse: HttpResponse<string> = new HttpResponse({
        body: jwt,
        headers: new HttpHeaders({location: teamUrl})
      });

      const captchaResponse: HttpResponse<string> = new HttpResponse({
        body: JSON.stringify({captchaEnabled: false})
      });

      mockTeamService.isCaptchaEnabled.and.returnValue(of(captchaResponse));
      mockTeamService.create.and.returnValue(of(createTeamResponse));

      component.requestCaptchaStateAndCreateTeam();

      expect(AuthService.setToken).toHaveBeenCalledWith(jwt);
      expect(mockRouter.navigateByUrl).toHaveBeenCalledWith(teamUrl);
    });
開發者ID:milesjos,項目名稱:retroquest,代碼行數:24,代碼來源:create.page.spec.ts

示例5: beforeEach

  beforeEach(async(() => {

    TestBed.configureTestingModule({
      declarations: [MaterialMock, MaterialTextfieldMock, SettingsGeneralComponent],
      imports: [RouterTestingModule, ReactiveFormsModule, CommonModule, FormsModule],
      providers: [
        { provide: Session, useValue: sessionMock },
        { provide: Client, useValue: clientMock },
        { provide: ThirdPartyNetworksService, useValue: thirdPartyNetworksServiceMock },
        { provide: ActivatedRoute, useValue: { params: of({ 'guid': '1000' }) } },
        { provide: Router, useValue: routerMock },
      ]
    })
      .compileComponents();
  }));
開發者ID:iamthelogik83,項目名稱:front,代碼行數:15,代碼來源:general.component.spec.ts

示例6: beforeEach

  beforeEach(async(() => {

    TestBed.configureTestingModule({
      declarations: [
        TokenPipe,
        MockComponent({ selector: 'm-wire-console--overview'}),
        MockComponent({ selector: 'm-wallet--balance-usd'}),
        MockComponent({ selector: 'm-wallet--balance-rewards'}),
        MockComponent({ selector: 'm-wallet--balance-tokens'}),
        WalletOverviewComponent
      ],
      providers: [
        { provide: Client, useValue: clientMock },
        { provide: WalletService, useValue: WalletServiceMock },
        { provide: BlockchainService, useValue: blockchainService },
        { provide: Router, useValue: RouterTestingModule },
        { provide: MindsTitle, useValue: MockService(MindsTitle) },
        { provide: Session, useValue: sessionMock },
        { provide: Storage, useValue: storageMock },
        { provide: ActivatedRoute, useValue: { url: of([{ path: 'newsfeed' }]), params: of({ filter: 'trending' }) } }
      ]
    })
      .compileComponents();  // compile template and css
  }));
開發者ID:iamthelogik83,項目名稱:front,代碼行數:24,代碼來源:overview.component.spec.ts

示例7: beforeEach

  beforeEach(async(() => {

    TestBed.configureTestingModule({
      declarations: [
        MockDirective({ selector: '[mdl]', inputs: ['mdl'] }),
        MockComponent({ selector: 'minds-card', inputs: ['object', 'hostClass'] }),
        MockComponent({ selector: 'minds-button', inputs: ['object', 'type'] }),
        BoostConsoleBooster
      ],
      imports: [RouterTestingModule, ReactiveFormsModule],
      providers: [
        { provide: Client, useValue: clientMock },
        { provide: Session, useValue: sessionMock },
        { provide: ActivatedRoute, useValue: { parent: { url: of([{ path: 'newsfeed' }]) } } }
      ]
    })
      .compileComponents();
  }));
開發者ID:iamthelogik83,項目名稱:front,代碼行數:18,代碼來源:booster.component.spec.ts


注:本文中的rxjs/internal/observable/of.of函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。