随笔分类 - 前端
摘要:1 代码结构 2 myc04.component.html <p>myc04 works!</p> <!--emit():触发msgEvent中的函数,就是show()--> <button (click)="msgEvent.emit('赵云')">Test 1</button> <button
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:1 代码结构 2 app.component.ts import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls
阅读全文
摘要:1 代码结构 2 myc02.component.ts 1 import { Component, OnInit } from '@angular/core'; 2 3 @Component({ 4 selector: 'app-myc02', 5 templateUrl: './myc02.com
阅读全文
摘要:1 代码结构 2 myc01.component.html 1 <p>myc01 works!</p> 2 3 <!--pipe管道--> 4 <!--与vue不同:vue中的管道需要用户自己定制声明--> 5 <!--angular官方提供了一些常用的管道--> 6 <ul> 7 <li>大写:{
阅读全文
摘要: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
阅读全文
摘要:1 代码结构 2 myc03.component.ts 1 import { Component, OnInit } from '@angular/core'; 2 3 @Component({ 4 selector: 'app-myc03', 5 templateUrl: './myc03.com
阅读全文
摘要:1 代码结构 2 myc02.component.ts 1 import { Component, OnInit } from '@angular/core'; 2 3 @Component({ 4 selector: 'app-myc02', 5 templateUrl: './myc02.com
阅读全文
摘要: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
阅读全文
摘要: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:
阅读全文
摘要: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:
阅读全文
摘要:类似CSS中class,一次给一组对象添加一个方法。 Array.prototype.sum=function() { var result=0; for(var i=0;i<this.length;i++) { result+=this[i]; } return result; }
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号