Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference error : angular is not defined #175

Open
ashokkumar24 opened this issue Aug 25, 2016 · 0 comments
Open

Reference error : angular is not defined #175

ashokkumar24 opened this issue Aug 25, 2016 · 0 comments

Comments

@ashokkumar24
Copy link

main.js

'use strict';
require.config( {

baseUrl : "",

paths : {

    "angular" : "client/assets/vendor/angular/angular.min",
    "angular-amd" : "client/assets/vendor/angularAMD/angularAMD.min",
    "ngload" : "client/assets/vendor/ng-load/ng-load",
    "ui-router" : "client/assets/vendor/angular-ui-router/release/angular-ui-router.min",
    "jquery" : "client/assets/vendor/jquery/dist/jquery.min",
    "bootstrap" : "client/assets/vendor/bootstrap/dist/js/bootstrap.min",
    "signupModule" : "client/signup/signup.application",
    "loginModule" : "client/login/login.application",
    "homeModule" : "client/home/home.application",
    "constant" : "client/core/constant"

},

shim : {

    "angular-amd" : [ "angular" ],
    'ngload' : [ 'angular-amd' ],
    "ui-router" : [ "angular"],
    "bootstrap" : [ 'jquery']

},

deps : [ 'app' ]

} );


App.js

define([
"angular-amd",
'jquery',
'bootstrap',
"ui-router",
"signupModule",
"loginModule",
"homeModule"

    ], function(angularAMD) {

            'use strict';
            var app = angular.module('app', [

                "ui.router",  
                "signup",
                "login",
                "home"

            ]);

            app.config([

                '$stateProvider',
                '$urlRouterProvider',

                function( $stateProvider, $urlRouterProvider ) {

                    $urlRouterProvider.otherwise( '/' );

                    //Route for home
                    $stateProvider.state( "home", {
                        url : '/',
                        views : {
                            '' : {
                                templateUrl: 'client/main.html'
                            },
                            'nav@home' : {
                                templateUrl : 'client/nav/view/nav.html', 
                            },
                            'body@home' : {
                                templateUrl : 'client/login/view/login.html',
                                controller : 'loginCtrl as login'
                            },
                            'footer@home' : {
                                templateUrl : 'client/signup/view/signup.html',
                                controller : 'signupCtrl as signup',
                            }
                        },
                        controllerUrl : 'ngload!signupModule',
                    });

                    //Home page route
                    $stateProvider.state("welcome", {

                        params: {'userObj': null},
                        url: '/welcome',
                        templateUrl: 'client/home/view/home.html',
                        controller: 'homeCtrl as home',
                        resolve: {
                                userObj: ['$stateParams', function($stateParams) {
                                    return $stateParams.userObj;
                                }]
                            },
                        controllerUrl: 'ngload!homeModule',

                    });

                }

            ]);

        return angularAMD.bootstrap( app );

});

I am getting Reference Error : Angular is not defined. Could you please help on this???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant