establish an AngularUI application

I am struggling to get a single page application up and running using AngularUi because I am facing challenges in making a basic example work. Below are the different files I have:

index.html :

<!doctype html>
<html lang="en" ng-app="studentDetailApp">
<head>
  <meta charset="UTF-8">
  <title>Student Details App</title>
  <link rel="stylesheet" href="../node_modules/angular-ui-bootstrap/ui-bootstrap-csp.css"/>
</head>

<body>
<div class="row-fluid" ng-controller="StudentController">
  <div class="span2">{{studentName}} </div>
  <div class="span4"><progress percent="studentMark"></progress></div>
</div>

<!--Required JS Files List :start -->
<script src="../node_modules/angular/angular.js"></script>
<script src="../node_modules/angular/angular-route.js"></script>
<script src="../node_modules/angular-ui-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="controllers/controllers.js"></script>
<script src="js/app.js"></script>
<!--Required JS Files List :end -->

</body>
</html>

controller.js :

'use strict';

/* Controllers Module for studentDetailApp application*/
var studentControllerModule = angular.module('studentDetailApp.controllers', ['ngRoute', 'ui.bootstrap']);

/*StudentController: controller for students*/
studentControllerModule.controller('StudentController', function($rootScope, $scope, $location, $routeParams) {

  $scope.studentName = "Sandeep Kumar Patel";
  $scope.studentMark = 75;

});

app.js :

'use strict';

angular.module('studentDetailApp', ['ngRoute', 'studentDetailApp.controllers']).

  config(['$routeProvider', function($routeProvider,StudentController) {

    $routeProvider.when('/', { controller: 'StudentController'});

    $routeProvider.otherwise({redirectTo: '/'});

  }]);

Despite having a progress bar, it seems like I am unable to access the controller data even though AngularUI is correctly initialized.

I am encountering this error :

Error: [$injector:modulerr] Failed to instantiate module studentDetailApp due to:

[$injector:modulerr] Failed to instantiate module studentDetailApp.controllers due to:

[$injector:nomod] Module 'studentDetailApp.controllers' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

http://errors.angularjs.org/1.4.7/$injector/nomod?p0=studentDetailApp.controllers

minErr/<@http://localhost:8080/node_modules/angular/angular.js:68:12

module/<@http://localhost:8080/node_modules/angular/angular.js:1986:1

ensure@http://localhost:8080/node_modules/angular/angular.js:1910:38

module@http://localhost:8080/node_modules/angular/angular.js:1984:1

loadModules/<@http://localhost:8080/node_modules/angular/angular.js:4390:22

forEach@http://localhost:8080/node_modules/angular/angular.js:336:11

loadModules@http://localhost:8080/node_modules/angular/angular.js:4374:5

loadModules/<@http://localhost:8

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Display varying HTML based on certain conditions using ng-repeat

In the realm of Angular, we have the ability to achieve the following: <tag ng-repeat="item in items">content..</tag> or <tag ng-repeat-start="item in items"></tag><tag ng-repeat-end></tag> An intriguing question ar ...

Troubleshooting the issue of process.nextTick not being recognized in Calgolia places.js

After successfully implementing Algolia's places.js in my Angular 7 project using NPM, I encountered an issue. I have integrated a form where one of the fields should be an input. <form [formGroup]="myForm"> <pre style="color: white; b ...

The failure of a unit test involving Jest and try-catch

I am facing an issue with creating unit tests using jest. exportMyData.js const createJobTrasferSetArray = async () => { const data = exportData(); const jobTransferSet = []; try { data.forEach((element) => { const JobPathArray = el ...

How to show a div for small screens only using Bootstrap 4 beta?

Previously, in Bootstrap alpha 6 I was able to achieve this by writing the following code for displaying a div's contents only for sm: <div class="hidden-md-up hidden-xs-down"> This content would only be visible for sm in Bootstrap 4 alpha 6 ...

Remove the column lines when hovering over a table to change the border color

I'm striving to update this table in a way that conceals the lines above the hovered point within that column. For instance, if the bottom middle box is hovered, three lines above it will be visible. My goal is to prevent those lines from being displa ...

Unable to modify data values within the MongoDB database

After executing this code, the username is not updated. I attempted using UpdateOne as well but that didn't solve the issue either. The initial intention was to update an array, but changing the username was a troubleshooting step. const mongoose = re ...

Delay timing for two instances in parallel execution using protractor

I have been using Protractor to automate my application with great success. I can efficiently execute my test cases both sequentially and in parallel. However, when running tests in parallel with 4 instances at a time, it seems to be causing issues with hi ...

Deliver the message at the perfect moment

Here's the situation ... I'm trying to figure out how to make a specific action happen every day at a set time using my code. Since I am currently learning JavaScript, I think I need to incorporate some kind of loop (although I'm not entire ...

Mobile browser viewport dimensions

My Nexus 5 shows a width of 360 when I visit . I am aware that there is a difference between my phone's resolution and the browser width. Despite this understanding, I encounter a problem when attempting to create a function that triggers at a width ...

Formik: encountering target as undefined while passing Material UI Date Picker as prop to React Component

I'm currently working on developing a component that can be reused. The idea is to pass form fields as props, but I ran into an issue when clicking on the datepicker field. The error message that pops up is: TypeError: target is undefined Any sugge ...

Sorting a List with jQuery Using Anchor Tags and 2 Criteria

I am currently developing a jQuery filter that allows users to filter a list based on two criteria sets - fruit type and color. For instance, if the user selects "Berry" as the fruit type, only berries will be displayed. Subsequently, if they choose "Red" ...

ExpressJS subclasses are failing to inherit attributes and properties in callback functions

Currently, I am utilizing ExpressJS 4.16 on Node v8.9.4 and have established a base controller to manage default routes with the following example: class BaseController { constructor(name, app, router, data) { this._name = name; this._app = app; ...

The image slider is blocking the dropdown functionality of the navbar on mobile devices

My code is experiencing a conflict of events. I have created a menu bar using nav bar, as well as an image slider called the caroussel. The issue arises when the window is minimized - the menu bar fails to drop down properly with the presence of the caro ...

Encountering PHP error when trying to access input type=file using jQuery/AJAX technique

I'm trying to use jQuery/AJAX to access the input type=file and pass the file value to a PHP page. However, I keep getting the following error message: Notice: Undefined index: file in D:\software installed\xampp\htdocs\contact-ma ...

Verify the form in AngularJS for any modifications

On my AngularJS-built HTML page, there is a form with various fields, along with Save, Back, and Cancel buttons. My goal is to implement a functionality where clicking the Back button triggers a prompt asking "Would you like to save your changes?" if any ...

Guide to updating a quoted string with a customized variation using JQuery or Javascript

I am in search of a solution to substitute all quoted strings within a sentence with the same quoted strings but in a modified format. Here is an illustration of what I am referring to: var str = 'name="benson"; password="1234"&ap ...

Navigating the intricacies of platform-specific settings in JavaScript

Currently, I am in the process of transferring an application from one PHP-based CMS to another (such as Wordpress, Joomla, etc.). I have established classes that enable my code to function seamlessly on each platform without any alterations (so far so goo ...

Send properties to axios hook that utilizes React suspense

I've been working on creating a hook that can fetch data and utilize React Suspense. With the guidance from the example on the page (and this article), I've developed a function (which I intend to convert into a hook) for fetching data. Example: ...

Issues connecting tables to Knockout group

I seem to be encountering some difficulties with the Knockout table bindings in my code. Here is a snippet that I am struggling with: Snippet: $(function () { var FileObject = function(id, name) { this.id = id; this.name = name; ...

Press the button using the spacebar

I am facing an issue where I have a button with an anchor element that I need to trigger with the spacebar key for accessibility purposes. However, instead of triggering the button, pressing the spacebar causes the page to jump down when the button is in f ...