当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript By.directive方法代码示例

本文整理汇总了TypeScript中@angular/platform-browser.By.directive方法的典型用法代码示例。如果您正苦于以下问题:TypeScript By.directive方法的具体用法?TypeScript By.directive怎么用?TypeScript By.directive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular/platform-browser.By的用法示例。


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

示例1: it

 it('should set the title to the navbar', () => {
   const component = fixture.debugElement.query(By.directive(NavbarComponent)).componentInstance;
   expect(component.title).toEqual(app.title);
 });
开发者ID:Hagendorn,项目名称:billing-ng2,代码行数:4,代码来源:app.component.spec.ts

示例2: getEmbeddedPlunkerComponent

 function getEmbeddedPlunkerComponent() {
   const compDe = liveExampleDe.query(By.directive(EmbeddedPlunkerComponent));
   return compDe && compDe.componentInstance as EmbeddedPlunkerComponent;
 }
开发者ID:jiw0220,项目名称:jigsaw,代码行数:4,代码来源:live-example.component.spec.ts

示例3: expect

 .then((fixture: ComponentFixture<any>) => {
   let query = fixture.debugElement.query(By.directive(SyncComponent));
   expect(query).toBeTruthy();
   expect(query.componentInstance).toBeTruthy();
 });
开发者ID:angular,项目名称:periscope,代码行数:5,代码来源:sync.component.spec.ts

示例4: it

		it('has no mail header component', () => {
			let mailHeader = fixture.debugElement.query(By.directive(MailHeaderComponent));
			expect(!!mailHeader).toBeFalsy();
		});
开发者ID:ziacik,项目名称:amelie-mail,代码行数:4,代码来源:app.component.spec.ts

示例5: it

 it('should render copyable directive', () => {
     const copyable = fixture.debugElement.query(By.directive(CopyableComponent));
     const copyableInstance = copyable.injector.get(CopyableComponent) as CopyableComponent;
     expect(copyableInstance.content).toEqual('a_value');
 });
开发者ID:andrask,项目名称:CloudFlow,代码行数:5,代码来源:info-item.component.spec.ts

示例6: beforeEach

 beforeEach(() => {
   directive = fixture.debugElement
     .query(By.directive(DataTableColumnDirective))
     .injector.get(DataTableColumnDirective);
 });
开发者ID:anisharknair,项目名称:ngx-datatable,代码行数:5,代码来源:column.directive.spec.ts

示例7: it

 it('should apply CSS class to component', () => {
   const compiled = fixture.debugElement.query(By.directive(LoadingComponent)).nativeElement;
   expect(compiled.className).toBe('loading');
 });
开发者ID:Hagendorn,项目名称:billing-ng2,代码行数:4,代码来源:loading.component.spec.ts

示例8:

/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

import {DebugElement} from '@angular/core';
import {By} from '@angular/platform-browser';

var debugElement: DebugElement;
class MyDirective {}

// #docregion by_all
debugElement.query(By.all());
// #enddocregion

// #docregion by_css
debugElement.query(By.css('[attribute]'));
// #enddocregion

// #docregion by_directive
debugElement.query(By.directive(MyDirective));
// #enddocregion
开发者ID:4vanger,项目名称:angular,代码行数:25,代码来源:by.ts


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