Thank you Anthony for the elegant solution. You made it possible that both ( jquery and angular ) live together.
I was thinking about switching totally from jquery to angular. is this a good strategic move? On Friday, June 15, 2012 6:24:13 PM UTC+3, Anthony wrote: > > Angular is a client-side framework, so you should be able to make it work > with web2py. Have web2py serve the initial page (i.e., the Angular > application), and then the Angular app would make Ajax requests to web2py. > > Using Angular for the views, one thing you'll miss out on is the way > web2py automatically generates the HTML for things like forms and grids > without you having to hand code them. To take advantage of web2py for those > things, you could have web2py generate some of the Angular views using > web2py templates. In that case, though, you'll have to deal with the fact > that both Angular and web2py use {{ }} as template delimiters. However, I > think you can configure Angular to us alternative delimiters (you can do so > in web2py as well, but it's tricky). You could also create a special web2py > tag that generates an Angular curly brace output: > > class ng(DIV): > tag = '' > def xml(self): > return '{{%s}}' % super(ng, self).xml() > > Then in a web2py template: > > {{=DIV(ng('myvariable'))}} > > would produce an Angular template with: > > <div>{{myvariable}}</div> > > Anthony > > On Friday, June 15, 2012 10:38:29 AM UTC-4, Ashraf Mansour wrote: >> >> Hi Massimo, >> >> What do you think about http://www.youtube.com/watch?v=WuiHuZq_cg4 ? >> >> is it web2pyable in version 2.0? >> >> Regards... >> >