Discussion for angular (2+) - need help? create a stackblitz with your issue to get help faster using this template: https://stackblitz.com/fork/angular-issue-repro2
just realised in my Universal app that Angular doesn't wait for my AWS Lambda invokes before returning the server response... I can't for the life of me get this wrapped in Zone.... how can I?
import AwsLambda from 'aws-sdk/clients/lambda';
import { Agent } from 'https';
return new AwsLambda({
httpOptions: {
agent: new Agent({
keepAlive: true,
maxSockets: 50,
rejectUnauthorized: true,
}),
},
})
.invoke({
FunctionName: 'some-graphqlServer',
InvocationType: 'RequestResponse',
Payload: JSON.stringify(payload),
})
.promise();I would have thought https in Node would be wrapped in a Zone... or maybe it's a problem with AwsLambda lib instead?
this.route.queryParams.subscribe((queryParams: Params) => {
this.dataModel.PropertyID = queryParams['id'];
console.log('ID', this.dataModel.PropertyID);
});
@mile-mijatovic do you have this in your Router root module?
RouterModule.forRoot([], {
paramsInheritanceStrategy: 'always',It'll allow your params to pass through all child components of a Routed component. it could be that you're looking in a child component (I don't know looking at your example)
this.dataModel.PropertyID = this.router
.parseurl(/sitelet?url=https%3A%2F%2Fweb.archive.org%2Fweb%2F20211024152621%2Fhttps%3A%2F%2Fgitter.im%2Fangular%2F%253Cspan%2520class%3D%2522keyword%2522%253Ethis%253C%2Fspan%253E.router.url)
.root.children.primary.segments[2].toString();
...
private propertySubject: BehaviorSubject<any> = new BehaviorSubject(this.dataModel);
getPropertyData(): Observable<any> {
return this.propertySubject.asObservable();
}
loadPropertyData() {
let apiURL =
Globals.baseAPIURL + 'investor/property/' + this.dataModel.PropertyID;
return this.http
.get<any>(apiURL, { headers: { idtoken: Globals.getAuthToken() } })
.subscribe(
(data) => {
if (data != null && data.data != null && data.isOK) {
this.propertySubject.next({
PropertyID: data.data.id,
imageUrl: '/assets/images/property-coming-soon.jpg',
Property: {
Address: data.data.address.fullAddress,
PricePerShare: data.data.pricePerShare,
TotalSharesAvailable: data.data.totalSharesAvailable,
},
Quantity: 1,
});
console.log('Data from service', data.data);
} else {
console.log('loadPropertyData: Empty');
}
},
(error) => {
this.propertySubject.error(error);
console.log('loadPropertyData: Error' + error);
}
);
}