angularjs code changes do not show up after browser refresh

后端 未结 17 1714
北海茫月
北海茫月 2020-12-13 09:35

Any time, I make code changes in .hmtl file or the .js file, the browser still renders the old code and my new code changes don\'t show up in the browser result.

Fo

17条回答
  •  爱一瞬间的悲伤
    2020-12-13 10:25

    You need to change the aspnetcore enviroment variable from production to development. From the official website:

    ... set an environment variable to tell ASP.NET to run in development mode:

    • If you’re using PowerShell in Windows, execute $Env:ASPNETCORE_ENVIRONMENT = "Development"
    • If you’re using cmd.exe in Windows, execute setx ASPNETCORE_ENVIRONMENT "Development", and then restart your command prompt to make the change take effect
    • If you’re using Mac/Linux, execute export ASPNETCORE_ENVIRONMENT=Development

    If you are in linux, you might have to do it as a superuser. i.e.

    sudo export ASPNETCORE_ENVIRONMENT=Development

    The value of the variable may revert back to Production after re-booting. If you want to work with several environments, I suggest you define them in the launchSettings.json file:

    {
          "iisSettings": {
          "windowsAuthentication": false,
          "anonymousAuthentication": true,
          "iisExpress": {
             "applicationUrl": "http://localhost:40088/",
             "sslPort": 0
          }
       },
         "profiles": {
           "IIS Express": {
              "commandName": "IISExpress",
              "launchBrowser": true,
              "environmentVariables": {
                  "ASPNETCORE_ENVIRONMENT": "Development"
              }
           },
           "IIS Express (Staging)": {
              "commandName": "IISExpress",
              "launchBrowser": true,
              "environmentVariables": {
              "ASPNETCORE_ENVIRONMENT": "Staging"
             }
           }
         }  
       }
    

    Read about environments here:

提交回复
热议问题