Difference between specifying objects on 'this' and returning the objects itself in a function
<p>I'm a total newbie to javascript. Was just wondering what is the difference between the following when using the controllerAs approach, and why the second approach doesn't work:</p>

<pre><code>angular.module("app")
        .controller("angularController", angularController);

function angularController() {
    this.hello = "hello";
    this.goodbye = "goodbye";
}
</code></pre>

<p>and</p>

<pre><code>angular.module("app")
        .controller("angularController", angularController);

function angularController() {
    var hello = "hello";
    var goodbye = "goodbye";

    return {
        hello: hello,
        goodbye: goodbye
    }
}
</code></pre>