我在Angular 2中做了一个小应用程序,我正在显示一个包含一些数据的表,当我点击我的表时,我想得到那些数据
这是代码:
HTML模板:
<tr *ngFor="let users of usersdata; let i = index">
<td (click)="data(users.username)">{{users.username}}</td>
<td (click)="data(users.email)">{{users.email}}</td>
<td (click)="data(users.id)">{{users.id}}</td>
<td (click)="data(users.roleId)">{{users.roleId}}</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
这是我的组成部分:
data(data: string) {
this.selectedParam.emit(data);
console.log(data);
}
Run Code Online (Sandbox Code Playgroud)
当我点击时我得到这个错误:
EXCEPTION: Error in .../userslist.component.html:22:16 caused by: self.parent._el_24 is not a function
Run Code Online (Sandbox Code Playgroud) 我正在切割一些 int 数组的图像...
int[] imagenes_originales = new int[] {
R.drawable.image1,
R.drawable.image2,
R.drawable.image3,
R.drawable.image4
}
int[] new_images;
for (a = 0; a <= 3; a++) {
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), imagenes_originales[a]);
int x = bitmap.getWidth(), y = bitmap.getHeight();
int escalax = getWindowManager().getDefaultDisplay().getWidth();
Bitmap recorte = Bitmap.createBitmap(bitmap, 0, y / 2, escalax, 100);
}
Run Code Online (Sandbox Code Playgroud)
如何在我的new_images[]变量中转换位图图像?