简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM