test1.component.html

<p class="p1">test1 works!</p>
<div (click)="clickDemo()" >我是div1的内容</div>
<input (keyup)="onkey($event)"  type="text">

test1.component.spec.ts

import { ComponentFixture, TestBed } from '@angular/core/testing';import { Test1Component } from './test1.component';describe('Test1Component', () => {let component: Test1Component;let fixture: ComponentFixture<Test1Component>;beforeEach(async () => {await TestBed.configureTestingModule({declarations: [ Test1Component ]}).compileComponents();});beforeEach(() => {fixture = TestBed.createComponent(Test1Component);component = fixture.componentInstance;fixture.detectChanges();});it('should create', () => {expect(component).toBeTruthy();});
});

test1.component.ts

import { Component, OnInit } from '@angular/core';@Component({selector: 'app-test1',templateUrl: './test1.component.html',styleUrls: ['./test1.component.css']
})
export class Test1Component implements OnInit {constructor() {// 先出现console.log(1);}ngOnInit(): void {console.log(2);}clickDemo(){console.log('1111');}onkey($event: any){this.values = event.target.value;}
}

运行结果

前端学习(2326):angular之用户输入数据相关推荐

  1. 前端学习(1350):用户的增删改查操作7增删改查

    demo25.js //创建http连接 const http = require('http'); //创建服务器 const app = http.createServer(); //第三方模块导 ...

  2. 前端学习(1349):用户的增删改查操作6删除

    //创建http连接 const http = require('http'); //创建服务器 const app = http.createServer(); //第三方模块导入 const mo ...

  3. 前端学习(1348):用户的增删改查操作5修改

    //创建http连接 const http = require('http'); //创建服务器 const app = http.createServer(); //第三方模块导入 const mo ...

  4. 前端学习(1347):用户的增删改查操作4修改

    //创建http连接 const http = require('http'); //创建服务器 const app = http.createServer(); //第三方模块导入 const mo ...

  5. 前端学习(1346):用户的增删改查操作3增加

    //创建http连接 const http = require('http'); //创建服务器 const app = http.createServer(); //第三方模块导入 const mo ...

  6. 前端学习(1345):用户的增删改查操作2

    //创建http连接 const http = require('http'); //创建服务器 const app = http.createServer(); //第三方模块导入 const mo ...

  7. 前端学习(1344):用户的增删改查操作1

    const http = require('http'); const mongoose = require('mongoose');//数据库连接 mongoose.connect('mongodb ...

  8. 技能学习:学习使用php(tp6框架) + vue.js,开发前端全栈网站-6.用户登录(二),token验证

    技能学习:学习使用php(tp6框架) + vue.js,开发前端全栈网站-6.用户登录(二),token验证 技能学习:学习使用php(tp6框架) + vue.js,开发前端全栈网站-1.工具和本 ...

  9. 技能学习:学习使用php(tp6框架) + vue.js,开发前端全栈网站-5.用户登录,密码的bcrypt(hash)加密与验证

    技能学习:学习使用php(tp6框架) + vue.js,开发前端全栈网站-5.用户登录,密码的bcrypt(hash)加密与验证 技能学习:学习使用php(tp6框架) + vue.js,开发前端全 ...

最新文章

  1. excel中最常用的30个函数_最常用日期函数汇总excel函数大全收藏篇
  2. 从事安卓开发6年,我都有哪些收获?
  3. MongoDB整理笔记の管理Replica Sets
  4. Grails通过sessionId获取session对象
  5. java字符串反转及替换_Java圆括号翻转字符串
  6. 【李宏毅2020 ML/DL】P22 Unsupervised Learning - Word Embedding
  7. 贪心法——LeetCode Assign Cookies分饼干
  8. 程序员英文简历范例(通用,含初级、中级和高级)
  9. oracle蓝屏解决方法,win10系统蓝屏怎么办 蓝屏代码0x000007e的3种解决方法
  10. 富途证券面经(一面挂)
  11. 完全卸载Android Studio的方法
  12. 2021-9.15基于目标速度的汽车 ACC系统油门控制策略研究-童宝锋
  13. uni-app自定义组件
  14. 微服务门神-Zuul
  15. 在苏州软件园培训的那俩月,我找到了生的希望
  16. ARM 立即寻址之立即数的形成 —— 如何判断有效立即数
  17. Windows下win32api下载地址
  18. TMS320C6678开发板( DSP+Zynq )RTOS综合功能案例,嵌入式必看!
  19. 【C/C++】freopen 函数和 fopen 函数|标准输入输入写入文件|屏幕输出写入文件
  20. pcie inbound和outbound关系

热门文章

  1. 20175305张天钰 《java程序设计》第四周课下测试总结
  2. Android 开发 存储目录的详解
  3. vue动态绑定类样式ClassName知多少
  4. 浅谈ASP.NET框架
  5. javascript 面向对象编程小记
  6. HDU 4033 Regular Polygon(二分+高精度)
  7. 本月 Windows Mobile 文章推荐
  8. 工程代码_Egret开发笔记(二)基础工程代码阅读
  9. linux hlist,linux内核V2.6.11学习笔记(2)--list和hlist
  10. linux服务器防病毒,Linux系统中你不需要防病毒?_服务器评论-中关村在线