public ActionResult Settings(string angularModuleName = "app.settings")
        {
            var settings = new SettingsDto
            {
                //get this value from web.config
                WebApiBaseUrl = "/api/reservation/"

                // ...
            };

            var serializerSettings = new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            };
            var settingsJson = JsonConvert.SerializeObject(settings, Formatting.Indented, serializerSettings);

            var settingsVm = new SettingsViewModel
            {
                SettingsJson = settingsJson,
                AngularModuleName = angularModuleName
            };

            Response.ContentType = "text/javascript";
            return View(settingsVm);
        }
Exemplo n.º 2
0
        public ActionResult Settings(string angularModuleName = "app.settings")
        {
            var settings = new SettingsDto
            {
                //get this value from web.config
                WebApiBaseUrl = "/api/reservation/"

                                // ...
            };

            var serializerSettings = new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            };
            var settingsJson = JsonConvert.SerializeObject(settings, Formatting.Indented, serializerSettings);

            var settingsVm = new SettingsViewModel
            {
                SettingsJson      = settingsJson,
                AngularModuleName = angularModuleName
            };

            Response.ContentType = "text/javascript";
            return(View(settingsVm));
        }