If I am going to develop a large scale SPA using CI as backend do I need to 
segregate the JS Model, View, Controller files for easy maintenance or how 
can we do the structure ?


On Friday, February 7, 2014 9:02:14 PM UTC+5:30, elsewares wrote:
>
> The easier but more fragile approach is adding custom routing in 
> config/routes.php to name all of the routes with Angular views.  So:
>
> $route['/angular/(:any)'] = '/angular/$1/#';
>
> Note that your controller action can simply ignore the useless '#' that 
> will be passed to it, or you can leverage that to render a different view 
> if it's absent.
>
> Also note that you need to add a similar route (/angular/(:any)/(:any)), 
> etc, for any route that passes variables to the actions.
>
> If you want to dive deeper, extend the base router class and have it 
> append the '#' to all routes that way.
>
> On Thursday, February 6, 2014 12:45:45 PM UTC-6, Gregory Thompson wrote:
>>
>> I'm building a site that will run on codeigniter and one of the main 
>> features of the site will be an angularjs application. I've tried loading 
>> this application through a controller say... Sell. My sell controller loads 
>> a view that has my angular setup in it. I ran into a few problems, I'm 
>> guessing mostly with the routing...
>>
>>    1. If I go to myurl.com/sell the angular app appears to initialize 
>>    but it doesn't add /#/ to the url therefor my routes in my app don't work.
>>    2. I can physically type in /sell/#/ and it works, which is good, but 
>>    it should be automatic.
>>    3. I can turn on html5mode, and that works perfectly fine but I'm 
>>    guessing it wouldn't work on non HTML5 browsers
>>
>> I'm suspecting that there's interference with CI's routing logic and 
>> AngularJs but it's really odd it's not automatically adding the #. I'm 
>> expecting a lot for you guys to understand the CodeIgniter routing but 
>> hopefully you have an idea.
>>
>> *Option 2 I tried...*
>>
>> Another solution would be to move the angular app folder to the directory 
>> root but it would be illogical to have a separate set of views, (header, 
>> footer includes etc.) for the ang.js app and for the rest of the 
>> codeigniter build. I was also wondering if it's possible to extend CI to a 
>> root folder so I can load views from the ang.js framework.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to