I don't think it's bad practice. $scope is setup to be hierarchal and will
inherit any parent scopes. So even if you provided a controller for the
template route, it would just be a parent controller to the ones specified
within the template.
On Wednesday, February 19, 2014 10:11:08 PM UTC-7, Keoki Zee wrote:
>
> Is it bad practice in AngularJS to have multiple controllers be
> responsible for managing a single route? For example, if I have a route set
> up like this:
>
> *$routeProvider.when('/', {*
> * templateUrl: '../partials/foo.html'*
> *});*
>
>
> and then in *foo.html*, I have two controllers *BarCtrl* and
> *SkadooshCrtl* like so:
>
> *<div ng-controller="BarCtrl"></div>*
> *<div ng-controller="SkadooshCtrl"></div>*
>
>
> I ask because I have an ASP.NET MVC background, where every route is
> handled by only one controller.
>
--
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/groups/opt_out.