Kenta Goto Kenta Goto - 3 months ago 9
AngularJS Question

Angular partial does not propagate edits to app

I am not sure what is going on but I am using Angular to build an app. All I am trying to do is inject a partial when states change. I am using ui-router. Here is my app code:

$stateProvider
.state('home', {
url: "/",
templateUrl: "homePartial/home.html",
controller: 'HomeCtrl',
data: {
authorizedRoles: [USER_ROLES.admin, USER_ROLES.editor, USER_ROLES.guest]
}
})

;
$urlRouterProvider.otherwise("/");


Here is my partial - home.html:

<p>test</p>


Now when I go to my app and click 'home' I see the contents of the partial BEFORE it was edited. It's almost like the partial didn't save. When I go to app/homePartial/home.html, I can see the changes propagated.

Answer

This is most likely a caching issue, clear your cache and refresh the page and you should see your modified page.

if you use Google Chrome, I'd advise ticking the "Disable Cache (while DevTool is open)" inside Dev tool -> settings