Skip to content

This Does Not Seem to Work #1

@joelcdoyle

Description

@joelcdoyle

I don't see an alert or a console message. I have verified that the library is being loaded along with angular.

app.js:

var myApp = angular.module("myApp", [
  'ngRoute',
  'routeScripts',
  'loginModule',
  'dashboardModule'
]);

myApp.config(['$routeProvider', '$locationProvider',
  function($routeProvider, $locationProvider){

    checkLoggedIn = 
    $routeProvider.
      when('/login', {
        templateUrl: 'views/login.html',
        controller: 'LoginController',
        js: 'login-includes.js'
      }).
      when('/dashboard', {
        templateUrl: 'views/dashboard.html',
        controller: 'DashboardController',
        js: 'dashboard-includes.js'
      }).
      otherwise({
        redirectTo: '/login'
      });

    $locationProvider.html5Mode({
      enabled: true,
      requireBase: false
    });

}]);

index.html:

...
<html lang="en" ng-app="myApp">
...
  <script type="text/javascript" src="vendor/angular.js/"></script>
  <script type="text/javascript" src="vendor/angular-route.js/"></script>
  <script type="text/javascript" src="vendor/route-scripts.js/"></script>
</body>

js/login-includes.js:

$(function(){
  console.log("hello!");
  alert("hello!");
});

File Structure:

dist
  js
    dashboard-includes.js
    login-includes.js
    dashboard.js // <-- the dashboard controller 
    login.js // <-- the login controller
    app.js
  index.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions