Observable from a string (Angular 2)
<p>I am pretty new to Observables. How would I create Observable just from a simple string? Then subscribe to it and output it when it changes.</p>

<p>Does that make sense? </p>

<p>I don't have any luck with google search. Probably wrong keywords?</p>

<hr>

<p>Adding some code for better explanation:</p>

<pre><code>My constructor on service

constructor() {
  // Create observable stream to output our data
  this.notice = Observable.create(
    (observer) =&gt; this.observer = observer;
  );
};

My method on service

set(string) {
  this.notice.subscribe((value) =&gt; {
    // Push the new value into the observable stream
    this.observer.next(string);
  }, (error) =&gt; console.log('Could not set data.'));
}

Calling service method 

setNotice(event) {
  event.preventDefault();

  // Calling service to set notice
  this.noticeService.set('This is a string');
}
</code></pre>

<p>I think I am doing something wrong here? But not sure how to ask. I would be grateful for any of the explanations.</p>