Hi
I want to be able to put another controller called (StartUpController) - 
see bottom of page for StartUpController - in the /cart template along with 
CartController.
So, in effect - albeit incorrect want something like...
 when('/cart',{template:'partials/partial1.html',controller:CartController, 
controller:StartUpController}).

Not sure how to do this.
Regards


 ...

angular.module('website', []).
config(function($routeProvider){
    $routeProvider.
            
when('/tableau',{template:'partials/tableau.html',controller:TableauCtrl}).
            
when('/crystal',{template:'partials/crystal.html',controller:CrystalCtrl}).
            
when('/cart',{template:'partials/partial1.html',controller:CartController}).
           
otherwise({redirectTo:'/home',template:'partials/home.html',controller:HomeCtrl});
    });
function MainCtrl($scope,$location){
    $scope.setRoute = function(route){
        $location.path(route);
    }
}

function TableauCtrl($scope) {
    //$scope.title = 'About Page';
    //$scope.body = 'This is About Page body';
    $scope.people=[
        {name:'openWin()'},
        {name:'HR_Dashboard_2'},
        {name:'BSG_Dashboard_3'},
        {name:'Marketing_Dashboard_4'},
        {name:'BSG_Dashboard_5'},
        {name:'Risk_Dashboard_6'},
        {name:'Risk_Dashboard_7'}];
    $scope.openWin= function(){
        window.open('https://google.co.uk/');
         };
}

function CrystalCtrl($scope) {
    //$scope.title = 'Experiments Page';
   // $scope.body = 'This is Experiments Page body';
}


function HomeCtrl($scope) {
    //$scope.title = 'Home Page';
   // $scope.body = 'This is Home Page body';

}


function CartController($scope) {
    $scope.items = [
    {title:'Paint Pots',quantity: 8, price: 3.95},
    {title:'Polka Dots',quantity: 17,price: 12.95},
    {title: 'Pebbles',quantity: 5, price: 6.95}
    ];
    $scope.remove = function(index) {
        $scope.items.splice(index,1);
    }
}


function StartUpController($scope) {
    $scope.funding = {startingEstimate: 0};

    var computeNeeded = function() {
        $scope.funding.needed = $scope.funding.startingEstimate * 10;
    };

    $scope.watch('funding.startingEstimate',$computeNeeded);
}

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

Reply via email to