我有一张表格正在填写add client表格.它工作正常,并显示更改.问题是我有一个选择列表,用户在其中选择特定的源,然后将其保存在ngmodel中.这是代码.
选择列表
<mat-select [(ngModel)]="model.source" name="source" placeholder="Select Source ">
<mat-option [value]="1 ">Upwork</mat-option>
<mat-option [value]="2 ">Refer from Friend</mat-option>
<mat-option [value]="3 ">Other</mat-option>
</mat-select>
Run Code Online (Sandbox Code Playgroud)
现在在我的表中,显示的值基于选择显示为1或2或3.我想写一些东西,这样的插值条件.
表场
<ng-container matColumnDef="source">
<mat-header-cell *matHeaderCellDef> Source </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.source ? if value is 1 : display (upwork), if value is 2 : display(refer from friend)}} </mat-cell>
</ng-container>
Run Code Online (Sandbox Code Playgroud)
有点像这样,我确实喜欢它,angularjs我不确定Angular
嗨,我刚刚按照本教程链接一步一步,我正在制作一个角度应用程序,它工作正常,但我在控制台中收到此错误V5 is not a function虽然应用程序工作正常.我附上了我拍摄的确切步骤以及我的控制台的屏幕截图.

你好我想实现google maps api在angular。这很简单,angularjs但是我不知道什么不起作用。我有一个简单的应用程序,可以显示产品及其位置。单击位置后,该位置确实会显示在地图上。但是我正在使用商店地图google maps。我做了很多。但是这个错误不断出现。
google is not defined
Run Code Online (Sandbox Code Playgroud)
app.component.ts
import { Component } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { ProductService } from './product.service';
declare var google: any;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
providers: [ProductService]
})
export class AppComponent {
//define an array of products
products = [];
//constructor func
constructor(private _productService: ProductService) { }
//after constructor func this func runs , in which we are
// …Run Code Online (Sandbox Code Playgroud) 刚开始angular2按照heroes教程学习。我正在创建一个请求,URL很好,参数也很好。但是我仍然很困惑为什么http://localhost:4200/要附加我的API通话,并且因此URL完全更改了,并且通话失败了。请对此问题有所了解。我在Google上搜索了很多,但可以找到原因。
我的创建方法
create(user: object): Promise<any> {
return this.http
.post('localhost/usmanProject/api/web/v1/users?access-token=n-EJtZiejtz5RSVWe-U14G4kCnPWMKf0', user, { headers: this.headers })
.toPromise()
.then(res => res.json().data)
.catch(this.handleError);
}
Run Code Online (Sandbox Code Playgroud)
我从API获取数据,我需要一个可搜索的,dropdown这样当我开始输入时,它会显示来自API的数据.目前我有这段代码.
<select class="formControl" name="repeatSelect" id="repeatSelect" ng-model="facilitiesData.business_id">
<option ng-repeat="option in businesses" value="{{option.id}}">{{option.business_name}}</option>
</select>
Run Code Online (Sandbox Code Playgroud)
谢谢.
我实施了一项支票,不想上传尺寸大于的图片4MB。我正在使用file reader和new image()。我有图像的大小和宽度。但是,如何获取文件大小。
function previewImage(element) {
var reader = new FileReader();
reader.onload = function (event) {
seAddArtist.imageSource = event.target.result;
$scope.$apply();
};
// when the file is read it triggers the onload event above.
reader.readAsDataURL(element.files[0]);
}
var img = new Image();
img.onload = function () {
alert(this.width + 'x' + this.height);
}
Run Code Online (Sandbox Code Playgroud)
我正在实现这两个结合,但如何检查图像的大小?
angular ×3
angularjs ×3
javascript ×2
append ×1
dropdown ×1
filereader ×1
filter ×1
function ×1
google-maps ×1
http ×1
localhost ×1
request ×1
search ×1
typeerror ×1
yeoman ×1