随笔分类 -  前端

摘要:1 代码结构 2 myc04.component.html <p>myc04 works!</p> <!--emit():触发msgEvent中的函数,就是show()--> <button (click)="msgEvent.emit('赵云')">Test 1</button> <button 阅读全文
posted @ 2022-06-14 19:57 孝文 阅读(53) 评论(0) 推荐(0)
摘要:1 代码结构 2 myc03.component.html <p>myc03 works!</p> <h3>name:{{name}}</h3> <h3>age:{{age}}</h3> <h3>老板:{{boss?.name}}-{{boss?.age}}-{{boss?.sex}}</h3> m 阅读全文
posted @ 2022-06-14 19:35 孝文 阅读(49) 评论(0) 推荐(0)
摘要:1 代码结构 2 myc02.component.html <p>myc02 works!</p> <h4>{{name}}</h4> <h4>{{age}}</h4> myc02.component.html 3 myc02.component.ts import { Component, OnI 阅读全文
posted @ 2022-06-14 19:02 孝文 阅读(37) 评论(0) 推荐(0)
摘要:1 代码结构 2 app.component.ts import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls 阅读全文
posted @ 2022-06-02 08:58 孝文 阅读(82) 评论(0) 推荐(0)
摘要:1 代码结构 2 myc02.component.ts 1 import { Component, OnInit } from '@angular/core'; 2 3 @Component({ 4 selector: 'app-myc02', 5 templateUrl: './myc02.com 阅读全文
posted @ 2022-05-15 20:35 孝文 阅读(54) 评论(0) 推荐(0)
摘要:1 代码结构 2 myc01.component.html 1 <p>myc01 works!</p> 2 3 <!--pipe管道--> 4 <!--与vue不同:vue中的管道需要用户自己定制声明--> 5 <!--angular官方提供了一些常用的管道--> 6 <ul> 7 <li>大写:{ 阅读全文
posted @ 2022-05-14 22:58 孝文 阅读(53) 评论(0) 推荐(0)
摘要:1 代码结构 2 myc04.component.html 1 <p>myc04 works!</p> 2 3 <!--自定义指令--> 4 <div> 5 <input type="text"> 6 </div> 7 <div> 8 <!--自定义指令:ng generate directive 阅读全文
posted @ 2022-05-14 17:34 孝文 阅读(31) 评论(0) 推荐(0)
摘要:1 代码结构 2 myc03.component.ts 1 import { Component, OnInit } from '@angular/core'; 2 3 @Component({ 4 selector: 'app-myc03', 5 templateUrl: './myc03.com 阅读全文
posted @ 2022-05-14 17:03 孝文 阅读(50) 评论(0) 推荐(0)
摘要:1 代码结构 2 myc02.component.ts 1 import { Component, OnInit } from '@angular/core'; 2 3 @Component({ 4 selector: 'app-myc02', 5 templateUrl: './myc02.com 阅读全文
posted @ 2022-05-14 16:46 孝文 阅读(88) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <script> 7 function setCookie(name,value,iDay) 8 { 9 var oDate=new Da 阅读全文
posted @ 2020-05-04 16:04 孝文 阅读(112) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <style> 7 #div1{width: 200px; height: 200px;background: red;position: 阅读全文
posted @ 2020-05-04 15:55 孝文 阅读(114) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <style> 7 #div1{width: 200px; height: 150px;background: red;position: 阅读全文
posted @ 2020-05-04 15:34 孝文 阅读(136) 评论(0) 推荐(0)
摘要:类似CSS中class,一次给一组对象添加一个方法。 Array.prototype.sum=function() { var result=0; for(var i=0;i<this.length;i++) { result+=this[i]; } return result; } 阅读全文
posted @ 2020-05-04 09:29 孝文 阅读(113) 评论(0) 推荐(0)
摘要:1 fucntion ajax(url,fnSuccess,fnFaild) 2 { 3 //1,创建Ajax对象 4 if(window.XMLHttpRequest){ 5 var oAjax=new XMLHttpRequest(); 6 } 7 else 8 { 9 var oAjax=ne 阅读全文
posted @ 2020-04-30 12:42 孝文 阅读(126) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <style> 7 #parent{width: 600px;height:20px;background-color:#CCC;posi 阅读全文
posted @ 2020-04-29 16:22 孝文 阅读(218) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <style> 7 #parent{width: 600px;height:20px;background-color:#CCC;posi 阅读全文
posted @ 2020-04-29 15:58 孝文 阅读(104) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <style> 7 #div1{width: 100px;height:100px;background-color:red;positi 阅读全文
posted @ 2020-04-29 15:31 孝文 阅读(113) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <style> 7 #div1{width: 200px;height:200px;background-color:red;positi 阅读全文
posted @ 2020-04-29 12:14 孝文 阅读(106) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <style> 7 #div1{width: 100px;height:100px;background-color:red;positi 阅读全文
posted @ 2020-04-29 12:12 孝文 阅读(120) 评论(0) 推荐(0)
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <style> 7 #div1{width: 100px;height:100px;background-color:red;positi 阅读全文
posted @ 2020-04-29 12:11 孝文 阅读(123) 评论(0) 推荐(0)