Ben,,

Can you share some of your code, I am particularly interested in how you 
got authentication working with mvc5.  are you passing back the token on 
every request?

Thanks
Manish

On Thursday, 31 October 2013 23:16:20 UTC, Beyers Cronje wrote:
>
> You can certainly do what you are describing. I'm currently using 
> AngularJS in a MVC 5 application, using standard MVC for authentication and 
> then SPA kicks in from /subscriber which index is served by the Subscriber 
> controller and Index action. From there all routing is handled by AngularJS.
>
> To give you an example, all the following URLs point to the same page and 
> work with standard MVC routing configured, with a Subscriber controller and 
> Index action method serving index.cshtml where ng-app is defined in:
>
> http://localhost/subscriber#/settings/company
> http://localhost/subscriber/#/settings/company
> http://localhost/subscriber/index#/settings/company
> http://localhost/subscriber/index/#/settings/company
>
> The above route is setup in AngularJS as follows:
>
>      $routeProvider
>>             .when('/settings/company', {
>>                 templateUrl: '/app/settings/company/company.html',
>>                 controller: 'companyController',
>>             })
>
>
> I've setup my solution directory structure such that my AngularJS files 
> all live under the app root directory of my MVC app, so I dont mix standard 
> MVC or Web API files with my Angular SPA files.
>
> Also, as you hinted at, you could theoretically have multiple 'SPAs' each 
> with their own start point. 
>
> Beyers
>
>
>
> On Friday, November 1, 2013 12:27:48 AM UTC+2, David Duff wrote:
>>
>> Hi,
>>
>> I'm new to AngularJS.  I'm trying to integrate it with ASP.NET MVC 4.  I 
>> think I'm doing something wrong and getting confused.
>>
>> If I set the Angularjs controllers and routing to starting with the 
>> HomeController and the corresponding index.cshtml in the root, it works. 
>>  However, the rest of the ASP.NET MVC 4 controllers are within the Areas 
>> folder (including authentication) and this is where I would like to start 
>> with AngularJS but I cannot get it work.  
>>
>> So say within the Areas I have a DashboardController with the 
>> corresponding dashboard.cshtml.  The dashboard.cshtml would be the start 
>> page, which uses routing, controllers, and partials.  My thinking is that I 
>> can use ASP.NET MVC 4 for logging in/authentication without using 
>> AngularJS (going to a url like /Dashboard/Index) and then when it reaches 
>> the dashboard I can set the application up as a SPA to start using the 
>> AngularJS routes, controllers and partials.
>>
>> Can I do this or does the start point have to sit at the HomeController 
>> level?
>>
>> If I can do it, can I set up different start pages for different areas or 
>> can I only have one start point?
>>
>> Sorry for the stupid questions and thanks in advance.
>> David
>>
>>
>>

-- 
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