简体   繁体   中英

ASp.NET MVC with Angular 5 project - Add environment config without angular-CLI.json file

I am building a new project in ASP.NET MVC integrated with the Angular 5 framework with the help of VS.NET 2017 .

I was following this article https://juristr.com/blog/2018/01/ng-app-runtime-config/ to implement the environment based configuration.

I am new to angular framework. This article is saying to add some environment key-value pairs to the .angular-cli.json file. But my project does not have this file.

Now my doubt is where do i place this below code logic :-

{
    "apps":[
        ...
        "environmentSource": "environments/environment.ts",
        "environments": {
            "dev": "environments/environment.ts",
            "staging": "environments/environment.staging.ts",
            "prod": "environments/environment.prod.ts"
        }
    ]
}

Please suggest.

This is because you are not using angular-cli. Install angular-cli using the following command on the terminal

npm install -g @angular/cli

Because you are not using angular cli you will have to add several packages and dependencies manually in the package.json file.

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