If you wand to show the values on application load you need to change the subject to BehaviorSubject
private _onChanged: BehaviorSubject<any> = new BehaviorSubject({});
public val= this._onChanged.asObservable();
update(input: any) {
this._onChanged.next(input);
}
constructor() { }
You have to bind to the right value in your display-component.component.html
part:
<p>
{{val}} <!--not {{result}}-->
</p>
I found a small thing in your code. instead of bellow
<p>
{{result}}
</p>
you should use
<p>
{{val}}
</p>
import React, { useContext } from 'react'; useContext is undefined. error details: Uncaught (in promise) TypeError: Object(...) is not a function error when processing const context = ...
import React, { useContext } from 'react'; useContext is undefined. error details: Uncaught (in promise) TypeError: Object(...) is not a function error when processing const context = ...
var imagecount = 1; var total = 3; I'd like to know why I can't make an imageslider this way. I have pictures saved such as studentbild1, studentbild2 and studentbild3. How do I get those to show in ...
var imagecount = 1; var total = 3; I'd like to know why I can't make an imageslider this way. I have pictures saved such as studentbild1, studentbild2 and studentbild3. How do I get those to show in ...
I'm in the process of making a code that prints all numbers divisable by 3 using an array, but im having trouble removing specific values. All the values i want prints correctly, but what i want is to ...
I'm in the process of making a code that prints all numbers divisable by 3 using an array, but im having trouble removing specific values. All the values i want prints correctly, but what i want is to ...
From MDN article about strict mode: First, strict mode makes it impossible to accidentally create global variables. In normal JavaScript mistyping a variable in an assignment creates a new ...
From MDN article about strict mode: First, strict mode makes it impossible to accidentally create global variables. In normal JavaScript mistyping a variable in an assignment creates a new ...