[users at bb.net] How to access global property from AngularJS www-frontend?

Pierre Tardy tardyp at gmail.com
Thu Apr 20 11:40:03 UTC 2017


Hi Alexey,
Glad to see you are trying yourself at www plugin!

www plugins are configured in c['www']

when you say
c['www'] = {
[...]
'plugins': {
'myplugins': True
}
You can also say
c['www'] = {
[...]
'plugins': {
'myplugin': {'config1: 'foo', 'config2': 'bar'}
}
this dictionary will then be automatically passed via the 'config'
angularJS constant.

buildbot_travis was using this feature in its first implementation (now it
is using a custom REST api in order to implement authz)

Pierre

On Thu, Apr 20, 2017 at 1:30 PM Alexey Demakov <demakov at ispras.ru> wrote:

> My www plugin requires some static info from configuration's global
> properties. I've read 3.1.7. Configuration in AngularJS
> <http://docs.buildbot.net/current/developer/config.html#configuration-in-angularjs>
> but not found a solution. I found config constant but it contains not all
> properties.
>
> This constant is initialized in www/config.py: IndexResource.renderIndex()
> method. I added my property and successfully got it in AngularJS controller.
>
> Is it possible to expose global property to AngularJS code without
> modifying buildbot's code?
>
> Regards, Aleksey
> _______________________________________________
> users mailing list
> users at buildbot.net
> https://lists.buildbot.net/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20170420/b8820f3e/attachment.html>


More information about the users mailing list