前沿web开发框架

Angular

Angular 是一个开发平台。它能帮你更轻松的构建 Web 应用。Angular 集声明式模板、依赖注入、端到端工具和一些最佳实践于一身,为你解决开发方面的各种挑战。Angular 为开发者提升构建 Web、手机或桌面应用的能力。

Angular6 获取屏幕宽度

2020年07月05日

最近需要在Angular开发中适配手机屏幕,需要知道屏幕宽度,具体代码如下:初始化的时候获取屏幕宽度:public innerWidth: any; ngOnInit() { this.innerWidth = window.innerWidth; }如果屏幕产生了旋转,或则在浏览器测试情况下,屏幕宽度变化:@HostListener('window:resize', ['$even...

Angular 在子组件调用父组件方法

2020年06月30日

子组件和父组件都要做一件事的时候,如果在父组件定义好了事件,那么在子组件如何调用呢?下面事详细示例代码:父组件Component:export class ContactInfo implements OnInit { phoneForm: FormGroup; phones: Phone[]; constructor(private fb:...

ng-template、ng-content、ng-container 一些文章搜集

2020年06月29日

这篇文章主要讲解了angular之ng-container 、ng-template的使用,文章地址:angular之ng-container 、ng-template的使用这篇文章主要讲解了这三个标签的使用:ng-template、ng-content、ng-container

Angular 获取屏幕宽度和高度

2020年06月28日

下面是获取屏幕宽度和高度的示例代码:import { Component, OnInit, OnDestroy, Input } from "@angular/core"; // Import this, and write at the top of your .ts file import { HostListener } from "@angular/core"; @Compone...

angular 代码示例 directive

2020年06月24日

import {AfterViewInit, Directive, ElementRef, EventEmitter, forwardRef, Injector, Input, NgZone, OnInit, Output} from '@angular/core'; import {AbstractControl, ControlValueAccessor, NG_VALUE_ACCESSOR...

Angular路由相干问题总结

2020年06月23日

对于Angular路由,在使用过程中存在的一些问题做一个总结。对于https://www.domain.com/help和https://www.domain.com/help/help_content,如果使用延迟加载,具体代码如下:{path: 'help', loadChildren: './common_article/help/help.module#HelpModule'},启用延迟加...

Angular json遍历

2020年06月23日

最近再使用Angular的时候,后端返回了一个复杂的数组,具体内容如下: var temp_array = [{ 'parent': { 'child': {'link': '/help/why_some_numbers_disappear', 'title': 'Why some numbers disappear'}, ...

Angular 媒体分享按钮代码片段

2020年06月22日

<button mat-icon-button aria-label="share link" matTooltip="Share" onclick="this.blur()" (click)="share($event)"> <mat-icon>share</mat-icon></button>share()事件代码:share(e) { this.dialog.open(ShareDial...