简体   繁体   English

Angular部分不会将编辑传播到应用程序

[英]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. 我不确定发生了什么,但是我正在使用Angular来构建应用程序。 All I am trying to do is inject a partial when states change. 我要做的就是在状态改变时注入一部分。 I am using ui-router. 我正在使用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: 这是我的部分-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. 当我转到app / homePartial / home.html时,可以看到传播的更改。

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 如果您使用的是Google Chrome浏览器,建议您在Dev tool -> settings勾选“禁用缓存(打开DevTool时)”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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