I am very new to AngularJS and SQL Server configuration issues.
I have developed AngularJS apps using ASP.NET MVC 5. Basically, the front-end is based on AngularJS and the back-end is in C#.
Once we put the apps in SQL Server, the application is working as expected. To run the application, I get the SurveyID = 1 (say) from the Web.Config file.
Right now, I want to run the same apps using a different SurveyID for multiple surveys.
a. The server folder is \\Survey with SurveyID = 1
b. The server folder is \\Survey2 with SurveyID = 2
c. The server folder is \\Survey3 with SurveyID = 3
d. The server folder is \\Survey4 with SurveyID = 4
Even though the apps put into a different folder structure, the apps always reads the root folder which happens to be \Survey with SurveyID = 1
But in the MVC Layout_Page, I am using the HTML tag I wonder if this is the cause of the root problem.
Right now, How Can I tell the angularJS apps which one is the root directory based on the Web.Config SurveyID
How can I resolve this issue? Inside MVC HOME Controller
DataAccessSurvey data;
int surveyID;
public HomeController()
{
data = new DataAccessSurvey();
surveyID = Convert.ToInt32(ConfigurationManager.AppSettings["SurveyId"]);
}
[HttpGet]
public ActionResult GetSurveyInfoData()
{
var surveyData = data.GetSurveyById(surveyID);
var Survey = new Survey();
//the rest of the code to populate the Survey related data
}
In Angular Controller.jS I call the following way
SurveyServices.getSurveyData()
.then(function (result) {
//alert("Success getSurveyData GetSurveyInfoData");
vm.SurveyInfo = result.data;
}
Please help me out. Thanks in advance.