Part 1 - Simple Contact Book application in angularjs

Before this article, we have done many examples using AngularJS like, fetch & dispaly data from databasecreate simple registration form with validationImplement AngularJS routing any much more. But  till now we have not created any complete application. Today I will show you how to create a very simple application using AngularJS in MVC.

Here in this part, I will try to make our application as simple as possible and later we will enhance this application part by part for making the article easy to understand.

Part 1 - Simple Contact Book application in angularjs
<!DOCTYPE html>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>

<body ng-app="myContactBook">
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                @Html.ActionLink("Application name", "Index", "Home", null, new { @class = "navbar-brand" })
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li><a href="#/home">Home</a></li>
                    <li><a href="#/savecontact/0">Add Contact</a></li>

    <div class="container body-content">
        <hr />
            <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>

    @RenderSection("scripts", required: false)
    <script src="~/Scripts/angular.js"></script>
    <script src="~/Scripts/angular-route.js"></script>
    <script src="~/Scripts/ngComponents/ngConfigs/main.js"></script>
    <script src="~/Scripts/ngComponents/ngControllers/homeController.js"></script>
    <script src="~/Scripts/ngComponents/ngControllers/saveContactController.js"></script>
    <script src="~/Scripts/ngComponents/ngControllers/errorController.js"></script>
    <script src="~/Scripts/ngComponents/ngServices/contactService.js"></script>


Posted By :