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

Alexey Demakov demakov at ispras.ru
Thu Apr 20 16:20:07 UTC 2017


Hi Pierre,

Thanks for solution, it works. :) Should find it myself, it IS in docs. 
Now I know the purpose of that dictionaries  in www plugins config. :)

Aleksey


On 20.04.2017 14:40, Pierre Tardy wrote:
> 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 
> <mailto: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 <mailto: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/351f6001/attachment.html>


More information about the users mailing list