Join the Stack Overflow Community
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I am working on developing an application in angular 1.4.7, my index.html file is as follows:

<!doctype html>
<html class="no-js" lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Foundation</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,400italic,300italic,300,600italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="css/foundation.min.css" />
    <link rel="stylesheet" href="css/app.css" />
    <script src="bower_components/modernizr/modernizr.js"></script>
    <script src="bower_components/system.js/dist/system.js"></script>
    <script src="app/system.config.js"></script>
</head>
<body>
    <div ui-view></div>
    <script>
        System.config({
            defaultJSExtensions: true
        });
        System.import('app/bootstrap');
    </script>
</body>
</html>

This code loads up my bootstrap file (here is the TS) :

"use strict";
import "angular";
import "jquery";
import "app/app"

angular.element(document).ready(() => {
    angular.bootstrap(document, ["app"]);
});

this gets angular and jquery loaded, and also by base app file, which is as follows:

import "angular-ui-router";
import "app/account/account";
import "app/account/service";

var app = angular.module("app", ["ui.router"]);

app.config(($stateProvider, $urlRouterProvider) => {
    ...ui router config
});

and my account.ts file that this imports:

module App.Account {
    'use strict';

    interface IAccountSummaryScope {
        service:IAccountService;
        account:any;
        init():void;
    }

    class SummaryController implements IAccountSummaryScope {
        service:IAccountService;
        account:any;

        static $inject = ["app.account.AccountService"];
        constructor(private svc:IAccountService) {
            this.service = svc;
            this.init();
        }
        init(): void {
            this.service.getAccount().then(d => {
                this.account = d;
            });
        }
    }

    angular.module("app").controller('app.account.SummaryController', SummaryController);
}

I am seeing the error:

Uncaught Error: [$injector:nomod] http://errors.angularjs.org/1.4.7/$injector/nomod?p0=app

This seems to indicate that the spot in my code where I am connecting my controller to my app has a problem where it cannot pull the app module. I am wondering if it is an order of operations issue? Anyone see anything suspect in my code?

Thanks for any help!

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.