“2020年6月”存档文章有30

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

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

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

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

Angular 获取屏幕宽度和高度

下面是获取屏幕宽度和高度的示例代码: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

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

Angular路由相干问题总结

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

Angular json遍历

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

SQLAlchemy 自连接

我们在使用 SQLAlchemy 的时候,经常会遇到自连接,例如:菜单下面有子菜单,类别下面有子类别,还有省下面有城市等,都可以用到自连接。数据表自关联的一对多关系,典型的就是父亲和子女的关系。我们通过在表中引用父亲的 id 来实现,然后通过反向链接来获取子女的信息。👇面是一个类与子类的自关联示例:class Category(db.Model): __tablename__ = 'c...

Angular 媒体分享按钮代码片段

<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...