Use templates with names
Pass config to PageController
Don't use rootScope variablse - replace with factory and local var