<repo_name>philipf/angularjs101<file_sep>/Angular1MvcBootstrap/App_Start/BundleConfig.cs
﻿using System.Web;
using System.Web.Optimization;

namespace Angular1MvcBootstrap
{
    public class BundleConfig
    {
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new StyleBundle("~/Content/css")
                .Include("~/Content/bootstrap.css")
                .Include("~/Content/bootstrap-theme.css")
                .Include("~/Content/site.css"));

            bundles.Add(new ScriptBundle("~/myApp")
                .Include("~/Scripts/angular.js")
                .Include("~/Scripts/angular-route.js")
                .Include("~/angular/app.js")
                .Include("~/angular/individual.js")
                .Include("~/angular/company.js")
                .Include("~/angular/submissionService.js")

                );
        }
    }
}
<file_sep>/Angular1MvcBootstrap/angular/submissionService.js
﻿(function() {
    'use strict';

    var app = angular.module('myApp');

    app.factory('submissionService', ['$http', submissionService]);

    function submissionService($http) {
        console.log('submissionService created');

        return {
            getCountries: function(successCallback, errorCallback) {
                //return ['USA', 'Singapore', 'South Africa'];
                $http.get('/api/submission/Countries').then(successCallback, errorCallback);
            }
        };
    }

})();<file_sep>/Angular1MvcBootstrap/Controllers/SubmissionController.cs
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace Angular1MvcBootstrap.Controllers
{
    public class SubmissionController : ApiController
    {
        [HttpGet]
        public IEnumerable<string> Countries()
        {
            return new [] { "USA", "South Africa", "Sudan", "Singapore" };
        }

        // GET: api/Submission/5
        public string Get(int id)
        {
            return "value";
        }

        // POST: api/Submission
        public void Post([FromBody]string value)
        {
        }

    }
}
<file_sep>/Angular1MvcBootstrap/angular/company.js
﻿(function() {
    'use strict';

    var app = angular.module('myApp');
    app.controller('companyController', ['$scope', companyController]);

    function companyController($scope) {
        console.log('companyController created');

    }
})();