我有一个复杂的对象,即,如下所示
someName = [
{name: "John",id: "1",rating: ['0', '1', '2', '3', '4', '5']},
{name: "robert", id: "2", rating: ['0', '1', '2', '3', '4', '5']},
{name: "luv", id: "3", rating: ['0', '1', '2', '3', '4', '5']}
];
Run Code Online (Sandbox Code Playgroud)
我想从中制作一份问卷,以确保他们从 0 到 5 给他们的答案打分,现在当我渲染我的 html 时,如下所示
<ng-container *ngFor="let sort of someName; let i=index">
<label id="example-radio-group-label">Rate your favorite section</label>
<mat-radio-group aria-labelledby="example-radio-group-label" class="example-radio-group" [(ngModel)]="sectionRating">
<mat-radio-button class="example-radio-button" *ngFor="let section of sort.sections" [value]="section">{{season}}</mat-radio-button>
</mat-radio-group>
</ng-container>
Run Code Online (Sandbox Code Playgroud)
这是正确呈现的,但是当我选择我的第一个问题评级为 1 时,它也从所有其他评级中进行选择,而且我想捕获这些我尝试过的每个评级,[(ngModel)]但它只给出一个值而不是数组
在我的 .ts 文件中,我将模型引用作为 Array 提供,如下所示:
sectionRating: any[] …Run Code Online (Sandbox Code Playgroud) 当我尝试将 Angular Web 应用程序添加为从 iOS safari 到主屏幕的快捷方式时,它会作为应用程序页面的屏幕截图出现,尽管我在 index.html 中添加了 apple-touch-icon 链接。我的图像尺寸为 150*150,png。下面是我的 HTML 代码
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Insights</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="src/assets/icons/favicon-32x32.png">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="manifest" href="manifest.webmanifest">
<link rel="apple-touch-icon" href="src/assets/icons/apple-touch-icon-150x150.png">
<meta name="theme-color" content="#1976d2">
</head>
<body>
<app-root></app-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我遇到的情况是我的数据来自服务器端,我必须将句子分成两行,
Example: Payment: xyz is done Removal: Refund made
Run Code Online (Sandbox Code Playgroud)
现在我必须通过在<br>前面添加一个标签将这句话分成两行Removal
需要帮助,尝试过indexOf,split但我无法找到解决方法。