上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 44 下一页
摘要: 1,变量类型 2,在python中,只要定义了一个变量,而且它有数据,那么它的类型就已经确定了,不需要开发者主动去说明它的类型,系统会自动辨别。 3,可以使用 type(变量的名字),查看变量的类型 阅读全文
posted @ 2020-02-16 22:43 shanlu 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1,单行注释 ①以#开头,#后跟空格,再添加文字 ②多行注释 阅读全文
posted @ 2020-02-16 22:29 shanlu 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 1 print("hello world") 阅读全文
posted @ 2020-02-16 22:18 shanlu 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 1 <div class="todolist"> 2 <h3>ToDoList</h3> 3 <input class="todo" type="text" [(ngModel)]="keyword" (keyup)=keyup($event)> 4 <p>代办事项:</p> 5 <h4 *ngFo 阅读全文
posted @ 2020-02-06 18:50 shanlu 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 1 <div class="search"> 2 <input type="text" [(ngModel)]="keyword">&nbsp;&nbsp;<button (click)="search()">搜索</button> 3 </div> 4 <div class="list" *ngF 阅读全文
posted @ 2020-02-06 17:13 shanlu 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 1 <h1>人员登记系统</h1> 2 <div class="form"> 3 <ul> 4 <li> 5 <label for="userName">姓名:</label><input type="text" id="userName" [(ngModel)]="peopleInfo.uName 阅读全文
posted @ 2020-02-06 16:06 shanlu 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 服务 demo28/ demo28component.ts 注入服务,根据服务中方法返回的结果,决定是否显示一个列表 custom.service.ts:封装一个方法 checkUserLogin,用来检查用户是否登录,返回true 就是登录状态,否则就是未登录 阅读全文
posted @ 2020-01-23 01:45 shanlu 阅读(67) 评论(0) 推荐(0) 编辑
摘要: ①创建一个服务类 @Injectable() 在服务类中定义方法、数据 sendRequest ( myUrl : string ) { return this.http.get( myUrl ).map( (response : Response) => response.json() ) } ② 阅读全文
posted @ 2020-01-23 01:43 shanlu 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 练习: 创建一个心跳服务, heartbeat.service.ts, 在这个服务中封装两个方法,分别是开始心跳和结束心跳 start:启动周期性定时器,每隔1秒,向控制台输入一句话:in heart beat stop: 结束定时器 demo26/demo26.component.ts 视图:有两 阅读全文
posted @ 2020-01-23 00:18 shanlu 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 服务: 在一个大型项目中,如果有一些方法或者数据,需要反复的用到,想办法去封装,方便进行复用,angular建议通过封装成一个对象 -->服务 服务,就是一个类,在这个类中封装一些常用到的方法或者数据 案例: 如果一个项目中,有非常多个组件,在测试开发,会输出一堆的日志信息,方便调试;发布到线上,挨 阅读全文
posted @ 2020-01-22 23:34 shanlu 阅读(196) 评论(0) 推荐(0) 编辑
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 44 下一页