> my problem is every time I go to a different view the page refreshes
> therefore I'm unable to access the factory service. The data being sent from
> Factory gets reset.
ng-view runs the controller initialization every time the url changes
so if there is any code like $scope.something = { } you will get a
completely new object. Factories usually return a new object, but a
service returns the same object. Unfortunately the the documentation
web page for angular services has had the distinction between
provider, factory, and service removed for reasons I can't comprehend,
and doesn't even include an example of using a service. They are all
based on the same code, but the differences are important.
If you use a service that just returns an object to store stuff and
call it in each of your controllers I think that will work.
function formStorageFunc() {
return {};
}
angular.service('formStorage', formStorageFunc);
// in directive
$scope.formData = formStorage();
> Why would one project refresh when jumping from one view to the next and the
> other project doesnt?
I'm not sure how you managed to make it not rerender. I never found a way.
I wrote my own version of ng-view to prevent rerendering, but haven't
made it general purpose enough to open source it yet. I believe the
angular-ui view also rerenders.
--
teknotus (Take Notice)