Cool. How did you manage to get authentication working?
Did you do it on a separate, "non Angular url", like 'default/user'? Did
you manage to get it with Angular?
Best,
Kristjan
On Saturday, 16 August 2014 15:28:52 UTC+2, dlypka wrote:
>
> I did not put a folder name such as your projects/.
> I kept the html paths flat.
>
> I converted the Angular Store sample to web2py + Angular:
>
> This worked for me:
> var storeApp = angular.module('AngularStore', ['ngRoute',
> 'angularTreeview']).
> config(['$routeProvider', function($routeProvider) {
> $routeProvider.
> when('/store', {
> templateUrl: 'store.htm',
> controller: storeController
> }).
> when('/products/:productSku', {
> templateUrl: 'product.htm',
> controller: storeController
> }).
> when('/cart', {
> templateUrl: 'shoppingCart.htm',
> controller: storeController
> }).
> otherwise({
> redirectTo: '/store'
> });
> }]);
>
> No need to specify index.html anywhere in the routing.
>
> I had a controller angularStore.py and so all the htmls (including
> index.html) are in folder:
> views/angularStore
>
> On Friday, August 15, 2014 11:59:29 AM UTC-5, Najtsirk wrote:
>>
>> OK, but how do I configure AngularJS routes?
>>
>> For example:
>> App.config(['$routeProvider',
>> function ($routeProvider) {
>> $routeProvider.
>> when('/', {
>> templateUrl: 'index.html',
>> controller: 'IndexCtrl'
>> }).
>> when('/projects', {
>> templateUrl: 'projects/index.html',
>> controller: 'ProjektiCtrl'
>> })
>> }]);
>>
>> How can I get routes to the partiapl templates right? Let's say that
>> partial template for '/projects' is in views/projects/index.html directory.
>> What is the right 'templateUrl' for this template?
>>
>> Best,
>> Kristjan
>>
>> On Friday, 15 August 2014 02:58:51 UTC+2, dlypka wrote:
>>>
>>> in the Views folders as usual.
>>>
>>> But then I also had to make controller functions for each .html. For
>>> example:
>>>
>>> def jqplot():
>>> # This method is necessary to allow views/home/jqplot.html to be
>>> rendered
>>> response.delimiters = ('{[',']}')
>>> return dict()
>>>
>>> On Thursday, August 14, 2014 3:41:19 PM UTC-5, Najtsirk wrote:
>>>>
>>>> Hello,
>>>>
>>>> i have problem with Web2py and AngularJS regarding routes. Where should
>>>> be partial .html files of specific routes stored? In static folder?
>>>>
>>>> Best,
>>>> Kristjan
>>>>
>>>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.