Skip to content

Instantly share code, notes, and snippets.

contactApp.controller('contactController',
['$scope', 'contactDataService', '$location',
function categoryController($scope, contactDataService) {
$scope.contacts = [];
loadContactData();
function loadContactData() {
contactDataService.getContacts()
.then(function () {
<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">
<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>
$routeProvider.when('/mycontacts/:id', {
templateUrl: "app/contact/html/contactForm.html",
controller: "contactEditController"
}),
$routeProvider.when('/mycontacts/newcontact', {
templateUrl: "app/contact/html/contactForm.html",
controller: "contactAddController"
}),
<div class="modal-header">
<button type="button" class="close" ng-click="cancel()" aria-hidden="true">&times;</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">
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";