# Need help to understand the below code

**URL:** <https://discourse.nodered.org/t/need-help-to-understand-the-below-code/60721>\
**Category:** General\
**Tags:** node-red-dashboard\
**Created:** [3 April 2022 12:54 UTC](https://discourse.nodered.org/t/need-help-to-understand-the-below-code/60721 "2022-04-03T12:54:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kai](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Kai](https://discourse.nodered.org/u/Kai)\
**Post date:** [3 April 2022 12:54 UTC](https://discourse.nodered.org/t/need-help-to-understand-the-below-code/60721/1 "2022-04-03T12:54:29Z")

</div>

Hi, I actually found a tutorial about how to access the message object in template script:

[https://flows.nodered.org/flow/2f1aaf0635f9bf23207152682323240a](https://flows.nodered.org/flow/2f1aaf0635f9bf23207152682323240a)

but I dont understand what is "scope" in the closure function..

hope someone can help on this 😅

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 April 2022 13:17 UTC](https://discourse.nodered.org/t/need-help-to-understand-the-below-code/60721/2 "2022-04-03T13:17:31Z")

</div>

Scope is an object generated by the AngularJS framework that node-red-dashboard is built around.

Read the built in help for the ui-template node. it shows you an example of using scope.

Also, see [here](https://www.google.com/search?q=angularjs+what+is+%24scope) for more info

---

<div class="post-metadata">

**Author:** ![Kai](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Kai](https://discourse.nodered.org/u/Kai)\
**Post date:** [4 April 2022 00:48 UTC](https://discourse.nodered.org/t/need-help-to-understand-the-below-code/60721/3 "2022-04-04T00:48:50Z")

</div>

Thank you 🙂 I will study on it

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 June 2022 00:49 UTC](https://discourse.nodered.org/t/need-help-to-understand-the-below-code/60721/4 "2022-06-03T00:49:42Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
