# First own UI node

**URL:** <https://discourse.nodered.org/t/first-own-ui-node/5236>\
**Category:** Dashboard\
**Created:** [27 November 2018 13:33 UTC](https://discourse.nodered.org/t/first-own-ui-node/5236 "2018-11-27T13:33:25Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [2 December 2018 13:26 UTC](https://discourse.nodered.org/t/first-own-ui-node/5236/5 "2018-12-02T13:26:18Z")

</div>

Hi @Georg25,

The `function(scope) { ... }` Javascript code from your example will now be runned on the **server-side** (i.e. in your flow), since it is located inside the `HTML` function. Indeed that `HTML` function is used to determine which html/javascript code needs to be send to the client-side (i.e. to the dashboard in the browser). Since the AngularJs scope is not defined on the server, you will get that error...

So you need to tell Node-RED that your Javascript code needs to be runned in the client-side (not in the server-side!). Think you have to put your code inside the `initController`, as you can see in this [discussion](https://discourse.nodered.org/t/announce-dashboard-version-2-10-0/4196/31?u=bartbutenaers).

But on the client-side you don't have the `config` (since that is the data from the config screen of your node on the server-side flow), so you will have to get the offPicture from elsewhere e.g. from the `msg.payload` ....

Bart

---

_[View the full topic](https://discourse.nodered.org/t/first-own-ui-node/5236)._
