Assuming $rootScope.module === directiveScope.module
Then this "problem" is because you de reference scope.module instead of mutating it:
var original = {name:"original"} ;
var copy = original;// copy is a reference to original (copy === original)
copy.name="copy";//mutating copy changes original
console.log(original.name);//=copy
//re assigning copy de references original
//copy no longer has a reference to original
//and carries it's own value
copy={name:"changed"};
console.log(original.name);//=copy (not changed)
A common mistake when passing object variables, sometimes you want to mutate them but re assign them and thereby de reference them and sometimes you don't want to change them but accidentally do by mutating them (someArray.sort() or someArray.push("new Item") or someObject.newItem=88 ...).
angular.extend does not re assign scope.module or $rootScope.module, the following:
angular.extend(scope.module, {
title: 'Redeclared'
});
Is the same as but slower than:
scope.module.title="Redeclared";
If rootScope.module was {somevar:22}
then both code examples would end up with {somevar:22,title:"Redeclared"}
It could be used for a situation where you have to mutate scope.module with a received json object:
scope.module.prop1 = receivedJSON.prop1;
scope.module.prop2 = receivedJSON.prop2;
//...many more
scope.module.prop100 = receivedJSON.prop100;
Would be a lot shorter with:
angular.extend(scope.module, receivedJSON);