Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Presenting backend data using AngularJS/AJAX in MVC VIEW

public IActionResult GetAllArticles()
    {   //query database to get all article with state.
        var articles = new List<Article>(){
            new Article() { Id = 1, Name = "A", SelectedState = "Open" },
            new Article() { Id = 2, Name = "B", SelectedState = "Scheduled" },
             new Article() { Id = 3, Name = "C", SelectedState = "Closed" },
        };
        return Json(articles);
    }
 
PREVIOUS NEXT
Tagged: #Presenting #backend #data #MVC #VIEW
ADD COMMENT
Topic
Name
3+1 =