当前位置: 首页 > news >正文

南通做网站的花云/浙江网站建设营销

南通做网站的花云,浙江网站建设营销,江门蓬江疫情,微信 微网站不创建spec.ts测试文件ng g c text1 --skipTeststruenumber 管道把数字变成字符串a3.1233121{{a|number}}// 3.123 默认保留三位小数JsonPipelet a{aa:xxx,bb:bb}{{a|json}}LowerCasePipe{{a|lowercase}}NgComponentOutlet把组件插入视图中public arr1: any[] [TextThreeCompo…

不创建spec.ts测试文件

ng g c text1 --skipTests=true

number 管道

把数字变成字符串

a=3.1233121

{{a|number}}

// 3.123 默认保留三位小数

JsonPipe

let a={aa:'xxx',bb:'bb'}

{{a|json}}

LowerCasePipe

{{a|lowercase}}

NgComponentOutlet

把组件插入视图中

public arr1: any[] = [TextThreeComponent, TextTwoComponent];

NgTemplateOutlet

Hello

TitleCasePipe

首字母大写

{{a | titleCase}}

ViewportScroller

定位滚动位置管理器

constructor(private scroller:ViewportScroller) { }

ngAfterViewInit() {

// 拿到 id=foot的位置

this.scroller.scrollToAnchor('foot')

// 自定义位置

this.scroller.scrollToPosition([0,100])

// 当前的位置

this.scroller.getScrollPosition()

// 禁用自动滚动恢复

this.scroller.setHistoryScrollRestoration()

}

@Attribute

指令传值, 某值作为常量字符串文字注入

1211212

@Directive({

selector: '[appTextTwo]'

})

export class TextTwoDirective{

constructor(@Attribute('numbers') types:string) {

console.log(types); //value

}

}

ContentChild

拿到ng-content投射的组件

export class TextTwoComponent implements OnInit,AfterContentInit {

@ContentChild(TextOneComponent) divs: any;

constructor() {

}

ngOnInit(): void {

}

ngAfterContentInit(){

console.log(this.divs);

}

}

ContentChildren

拿到ng-content 的DOM

sssss

export class TextTwoComponent implements OnInit,AfterContentInit {

@ContentChildren(TextOneComponent) tabs!: QueryList;

constructor() {

}

ngOnInit(): void {

}

ngAfterContentInit(){

console.log(this.tabs);

}

}

ViewChildren

不包含 ng-content 标签存在的元素

export class TextTwoComponent implements OnInit, AfterViewInit {

@ViewChildren(FriendComponent) friend: QueryList;

constructor() {

}

ngOnInit(): void {

}

ngAfterViewInit(){

console.log(this.friend);

}

}

ViewChild

会在dom视图中查找能匹配上该选择器的第一个元素或指令,跟ViewChild类似

QueryList

适用于 ContentChildren 和ViewChildren 提供对象类型

HostListener

@Directive({selector: 'button[counting]'})

class CountClicks {

numberOfClicks = 0;

@HostListener('click', ['$event.target'])

onClick(btn) {

console.log('button', btn, 'number of clicks:', this.numberOfClicks++);

}

}

http://www.jmfq.cn/news/4919977.html

相关文章:

  • 长安网站建设详细教程/软文营销的定义
  • 黑客网站免费盗号/找seo外包公司需要注意什么
  • 自己电脑做网站好吗/黄页88网官网
  • 网站如何测试/小学生收集的新闻10条
  • 学校网站制作方案/seo研究中心怎么了
  • 17网站一起做网店类似的/安康地seo
  • 西宁高端网站建设/电商培训机构靠谱吗
  • 响应式网站 谷歌 移动网站/体验营销案例分析
  • 购物网站优惠券怎么做/简述seo对各类网站的作用
  • 做网站语言学什么/第三方网站流量统计
  • 做与食品安全有关的网站/济南seo优化公司
  • 盱眙有做网站开发的吗/我想学做互联网怎么入手
  • 手机cms建站系统/青岛做网络推广的公司有哪些
  • wordpress苏醒主题破解/seo具体是什么
  • 网站建设全过程/磁力猫torrentkitty官网
  • 政府门户网站建设情况/效果好的东莞品牌网站建设
  • 宿州网站建设时间/厦门seo怎么做
  • 呼和浩特建设工程安全管理网站/网络推广策划案
  • 公司网站封面怎么做/惠州seo招聘
  • 招商门户网站建设方案/怎么做app推广代理
  • 济南专业做网站公司/网站排名优化的技巧
  • 网站建设营业执照如何写/苏州网站建设开发公司
  • 外贸企业做网站/好的营销网站
  • 做网站要学哪些程序/关键词排名查询官网
  • 涂料网站建设/九江seo
  • 作文网址/网站怎样优化文章关键词
  • 网站首页下拉广告/企业站seo案例分析
  • 专做宝宝辅食的网站/seo专家招聘
  • 北京行业网站制作/网站排名软件
  • pc网站建设建站模板/百度竞价恶意点击软件