I have this view in AngularJS:
<form ng-submit="addCust.submit();" ng-controller="AddCustomerCtrl as addCust">
<div>
<input type="text" ng-model="addCust.cName" required />
</div>
<div>
<input type="text" ng-model="addCust.cCity" required />
</div>
<div>
<button type="submit">Add Customer</button>
</div>
And my controller is:
helloWorldControllers.controller('AddCustomerCtrl',['$scope','$location',
function AddCustomerCtrl($scope, $location){
$scope.submit = function(){
$location.path('/addedCustomer/' + $scope.cName + "/" + $scope.cCity);
};
}
]);
But the "as" operator doesn't work in my netbeans.
My goal is to attach multiple controllers to one element, so I don't want to change the name of controller in itself, but as needed in the view where I want to attach controller to the element. Can anyone please help me where it is wrong? Thanks a lot.