Lead = {
name: '',
phones: []
}
<mat-form-field *ngFor="let n of Lead.phones">
<input type="tel" matInput [(ngModel)]="Lead.phones[n]" [ngModelOptions]="{standalone: true}" placeholder="comment">
</mat-form-field>
Lead = {
name: '',
phones: ['']
}
{
"_id": {
"$oid": "5c6c6006ed46f70824809388"
},
"contactPhones": [
""
],
"contactEmail": [
""
],
"comments": [
{}
],
"tasks": [],
"firmName": "В этой базе массив contactPhone имеет пустую строку",
"address": "",
"contactName": "",
"position": "",
"lprsName": "",
"parser2gis": "",
"createdDate": {
"$date": "2019-02-19T19:57:17.699Z"
},
"__v": 0
}
app.get('*', function(req, res) {
res.sendFile(path.join(__dirname, '/dist/cleanupCRM/index.html'));
}); //error on get some info "ReferenceError: path is not defined"
Cannot GET /someurl
constructor(
private myHttp: myHTTPService
) { }
getLeadList() {
return this.myHttp.getHTTP('/getLeadList');
}
Response {type: "basic", url: "http://localhost:4200/getLeadList", redirected: false, status: 200, ok: true, …}
fetch(url).then( res => console.log(res) );
getLeadList() {
return this.myHttp.getHTTP('/getLeadList/lead1');
}
getHTTP(url) {
return this.http.get(url, {responseType: 'text'}).subscribe((data) => {
console.log(data);
}, (error) => {
console.log("Error", error);
});
}
router.get('/getLeadList/lead1', function(req, res) {
console.log(req);
db.Lead.find({}).then(function(leads) {
console.log(leads);
res.send(leads);
});
});
router.get('/getLeadList', function(req, res) {
console.log(req);
db.Lead.find({}).then(function(leads) {
console.log(leads);
res.send(leads);
});
});
Я подписан на формгруппы