Hi Sander,I get error in the call of .map(this.secondstep) in the GetResult methodEXCEPTION: Cannot read property 'get' of undefinedAs you see below, call tothis.getUserGroups() works but when calling.map(this.getUserProps) it failsIsEditable() {console.log("IsEditable ...");return this.getUserGroups().map(this.getUserProps)
.subscribe(data => {/* all data is available here */
console.log("Is Editable ... " + JSON.stringify(data))});}getUserProps(data) {console.log("getUserProps ...");
let header = new Headers();header.append("Content-Type", "application/json; odata=verbose");header.append("Accept", "application/json; odata=verbose");return this.http.get(this._url, {headers: header
}).map((response: Response) => response.json()).map((r) => data.getUserProps = r);}Thank you
i don't think we can use map here as http and other functions are not available in the map called function it's a scope issue
On Wednesday, March 8, 2017 at 5:47:40 PM UTC-8, celerity12 wrote:To be more specific the error is err = TypeError: Cannot read property 'get' of undefined at MapSubscriber.UserPermissionService.getUserProps
Hi Sander,
this.getUserGroups() works but when calling
.map(this.getUserProps) it fails
IsEditable() {console.log("IsEditable ...");return this.getUserGroups().map(this.getUserProps)
.subscribe(data => {
/* all data is available here */
console.log("Is Editable ... " + JSON.stringify(data))
});}getUserProps(data) {console.log("getUserProps ...");
let header = new Headers();
header.append("Content-Type", "application/json; odata=verbose");header.append("Accept", "application/json; odata=verbose");return this.http.get(this._url, {headers: header
}).map((response: Response) => response.json())
.map((r) => data.getUserProps = r);}
On Monday, March 6, 2017 at 8:41:22 PM UTC-8, Sander Elias wrote:
.map((r) => data.getUserProps = r);.map((r) => (data.getUserProps = r,data));