Angular 2 and web2py

488 views
Skip to first unread message

John Philip

unread,
Jan 6, 2017, 5:27:50 AM1/6/17
to web2py-users
Hi there,

I searched for this however I could not find an answer. Is it possible to use Angular 2 in web2py ? 

thanks and regards,

John

António Ramos

unread,
Jan 6, 2017, 5:41:07 AM1/6/17
to web...@googlegroups.com

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Philip

unread,
Jan 6, 2017, 5:48:36 AM1/6/17
to web2py-users
Hi Ramos,

thanks for your quick reply. I did manage to get angular js working but I was wondering if it also works for Angular 2 since this is a bit different to Angular JS.

thanks,

John


On Friday, January 6, 2017 at 11:41:07 AM UTC+1, Ramos wrote:
2017-01-06 10:27 GMT+00:00 'John Philip' via web2py-users <web...@googlegroups.com>:
Hi there,

I searched for this however I could not find an answer. Is it possible to use Angular 2 in web2py ? 

thanks and regards,

John

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

António Ramos

unread,
Jan 6, 2017, 6:30:42 AM1/6/17
to web...@googlegroups.com
I gave up on angular when i found Vuejs.... 

To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

Anthony

unread,
Jan 6, 2017, 8:15:15 AM1/6/17
to web2py-users
No reason you can't use Angular 2 with web2py, as web2py handles the back end and Angular 2 is a front end framework. The only potential issue is if you are using web2py templates that include Angular template code, you need to change the template delimiters in either web2py or Angular, as already noted.

Anthony

John Philip

unread,
Jan 6, 2017, 9:50:35 AM1/6/17
to web2py-users
Thanks Anthony and Ramos for your help. Much appreciated!

John

anil...@capitalfloat.com

unread,
Mar 15, 2018, 11:05:56 AM3/15/18
to web2py-users
I tried integrating angular5+ framework in my already existing  web2py framework and Its running fine, Changed delimiter and interpolation in angular .   I am not able to fetch variables defined in web2py from script tag in index.html, is the only issue 

For exp : 

<script type='text/javascript'>  
    var baseUrl = "{{=BASE_PATH_APPFORM}}";    //  Not able to render web2py variable here in index.html 
</script>

Anthony

unread,
Mar 15, 2018, 11:47:17 AM3/15/18
to web2py-users
On Thursday, March 15, 2018 at 11:05:56 AM UTC-4, anil...@capitalfloat.com wrote:
I tried integrating angular5+ framework in my already existing  web2py framework and Its running fine, Changed delimiter and interpolation in angular .   I am not able to fetch variables defined in web2py from script tag in index.html, is the only issue 

For exp : 

<script type='text/javascript'>  
    var baseUrl = "{{=BASE_PATH_APPFORM}}";    //  Not able to render web2py variable here in index.html 
</script>

What happens instead? Do you get an error? Where is that variable defined?

Anthony

anil...@capitalfloat.com

unread,
Mar 20, 2018, 3:49:35 AM3/20/18
to web2py-users
Hi Anthony , 

We have defined that variable in python controller.py as exmple below.
Its broadcasted to index file using locals();

def adhar():
response.view = "angular/adhar/index.html"
return locals()

Anthony

unread,
Mar 20, 2018, 7:47:40 AM3/20/18
to web2py-users
On Tuesday, March 20, 2018 at 3:49:35 AM UTC-4, anil...@capitalfloat.com wrote:
Hi Anthony , 

We have defined that variable in python controller.py as exmple below.
Its broadcasted to index file using locals();

def adhar():
response.view = "angular/adhar/index.html"
return locals()

I don't see the variable in question in the above function, so perhaps you mean you have defined it at the top level of the controller. If that is the case, it will not be available in any views -- locals() is a dictionary including only variables defined locally within the function that contains it.

Anthony
Reply all
Reply to author
Forward
0 new messages