This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MongoDB.Driver; | |
using System; | |
namespace mvcMongoDB.Models | |
{ | |
public class CountryDB | |
{ | |
//For Best practice, Please put this in the web.config. This is only for demo purpose. | |
//==================================================== | |
public String connectionString = "mongodb://localhost"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="modal-header"> | |
<button type="button" class="close" ng-click="cancel()" aria-hidden="true">×</button> | |
<h3 class="modal-title">Delete {{contact.firstName}} {{contact.lastName}}</h3> | |
</div> | |
<div class="modal-body"> | |
<div class="container"> | |
<form class="form-horizontal" role="form" id="contactForm" name="contactForm"> | |
<!--<div class="col-sx-12 col-sm-8 col-md-6 col-lg-6">--> | |
<div class="form-group"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$routeProvider.when('/mycontacts/newcontact', { | |
templateUrl: "app/contact/html/contactForm.html", | |
controller: "contactAddController" | |
}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$routeProvider.when('/mycontacts/:id', { | |
templateUrl: "app/contact/html/contactForm.html", | |
controller: "contactEditController" | |
}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table class="table table-striped"> | |
<thead> | |
<tr> | |
<td>Last Name</td> | |
<td>First Name</td> | |
<td>Email</td> | |
<td>Mobile</td> | |
<td></td> | |
</tr> | |
</thead> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="panel panel-primary"> | |
<div class="panel-heading">Contact Form</div> | |
<div class="panel-body"> | |
<form class="form-horizontal" role="form" id="contactForm" name="contactForm"> | |
<div class="form-group"> | |
<label for="firstName" class="col-sm-3 control-label">First Name</label> | |
<div class="col-sm-6"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contactApp.controller('contactController', | |
['$scope', 'contactDataService', '$location', | |
function categoryController($scope, contactDataService) { | |
$scope.contacts = []; | |
loadContactData(); | |
function loadContactData() { | |
contactDataService.getContacts() | |
.then(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contactApp.factory('contactDataService', ['$http', '$q', | |
function ($http, $q) { | |
var _contacts = []; | |
var _getContacts = function () { | |
var deferred = $q.defer(); | |
var controllerQuery = "contact/GetContacts"; | |
$http.get(controllerQuery) | |
.then(function (result) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Contacts.Helpers; | |
using Contacts.Models; | |
using System.Web.Mvc; | |
using System.Linq; | |
using System.Net; | |
namespace Contacts.Controllers | |
{ | |
public class ContactController : JsonController | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundles.Add(new ScriptBundle("~/bundles/angularApp").Include( | |
"~/Scripts/Angular1.3.5/angular.js", | |
"~/Scripts/Angular1.3.5/angular-route.js", | |
"~/Scripts/Angular1.3.5/angular-resource.js", | |
"~/Scripts/Angular1.3.5/angular-ui-bootstrap.js", | |
"~/App/contactApp.js", | |
"~/App/clientRoute.js", | |
"~/App/DataService/contactDataService.js", | |
"~/App/contact/controller/contactController.js" | |
)); |
NewerOlder