随堂小练小功能小结

数据显示:

const url = 'url地址';
this.http.get(url).subscribe(
      res => {
        if (res.json().code === '0000') {
				this.lesson = res.json().data;  //赋值给lesson;通过数据绑定显示在HTML页面
			 }
      }
    );

数据绑定:双向绑定

{{item.questionContent}}
[]单向绑定

*ngFor循环数组

*ngFor='let item of lesson'

事件
(click)="SavaExamId()"点击事件
(updateAnswer)=“changeAnswerSheet($event)”

路由跳转:(两种方式)

this.router.navigate(['tabs/home/student-main/exam-mode/question'], {
     // queryParams: {
     //   courseId: 1071025936788471810,
     //   questionTypeId: 1072112901400514563
     // }
   });

this.router.navigateByUrl('question1');

轮播图实现卡片切换:

 <ion-card class="cardexam" lines="none">
    <ion-slides style=" height: 80%; width: 90% ">
        	<ion-slide *ngFor='let item of exampaper,let i=index'>
     </ion-slide>
       </ion-slides>
    </ion-card>

内容居左:(通过style样式调整)(合理运用空格&nbsp;和换行</br>也会非常方便界面调整)

<div style="float:left">
</div>

内循环显示数据ABCD;
{{alphabet[j]+’. '}}

通过id和name唯一标识单选按钮;

<input type="radio" name="{{item.questionId}}" id="{{item.questionId}}">

获得div元素属性:

<div id="sidebar_left">
const oDiv = document.getElementById('sidebar_left');
通过元素hidden属性来控制div显示和隐藏;

界面拼接:合理运用div实现;
基础运用好了,就会非常厉害了。
在这里插入图片描述

评论 34
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值