An error occurred while trying to create the scheduleApp module:

CSS

<!DOCTYPE html>
<html ng-app="scheduleApp">
<head>
<title>AngularJs Schedule</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="js/angular.js"></script>
<script src="js/angularfire.min.js"></script>
<script src="js/firebase.js"></script>
</head>
<body>

<div class="container"  ng-controller="mainController">

    <div class="page-header text-center">

        <h1>Schedule City</h1>
    </div>
    <div class="row times">
        <div class="col-xs-4 text-center">

        <h2>{{day.name}}</h2>
        <div class="time-slot" ng-repeat="slot in day.slots">
                    </div>

JavaScript

angular.module('programApp',['firebase'])
.controller('mainController', function($scope){

var ref = new Firebase("https://torrid-inferno-884.firebaseIO.com/days");
var fb = $firebase(ref);
var syncObject = fb.$asObject();
syncObject.$bindTo($scope,'days');

  $scope.reset = function() {    

            fb.$set({
              monday: {
                name: 'Monday',
                slots: {
                  0900: {
                    time: '9:00am',
                    booked: false
                  },
                  0110: {
                    time: '11:00am',
                    booked: false
                  }
                }
              },
              tuesday: {
                name: 'Tuesday',
                slots: {
                  0900: {
                    time: '9:00am',
                    booked: false
                  },
                  0110: {
                    time: '11:00am',
                    booked: false
                  }
                }
              }
            });    

          };



});

Error: [$injector:nomod] Module 'programApp' 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.

Answer №1

It looks like there was an issue with the file loading sequence. Make sure that firebase.js is included before angularfire.min.js because it relies on firebase.js code internally.

<script src="js/angular.js"></script>
<script src="js/firebase.js"></script>
<script src="js/angularfire.min.js"></script>
<script src="js/otherscripts.js"></script>

Important Update:

Don't forget to include $firebase dependency in your controller function

.controller('mainController', function($scope, $firebase){

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

Three.js: Obtain the latest vertex positions using morph targets

I have successfully implemented some morph targets in my project: View the working morph targets here (Don't forget to use the slider control to see the morph effect in action) However, I am facing an issue where I cannot access the updated position ...

Ways to set a random value to a data attribute from a specified array while using v-for in Vue.js?

In my main Vue instance, I have a data attribute that consists of an array containing 4 items: var app = new Vue({ el: '#app', efeitosAos: ['fade', 'flip-up', 'slide-up', 'zoom-in'] ...

Using ReactJS to create cross-browser inline styling with flexbox

I'm currently working on a React web application that relies heavily on inline styling. My goal is to ensure compatibility with the latest versions of major browsers (Safari, Chrome, Firefox, IE) while utilizing flexbox for layout. The issue I encou ...

How can I generate codegen types using typeDefs?

I have been exploring the capabilities of graphql-codegen to automatically generate TypeScript types from my GraphQL type definitions. However, I encountered an issue where I received the following error message: Failed to load schema from code file " ...

Uh-oh! An unexpected type error occurred. It seems that the property 'paginator' cannot be set

I am developing a responsive table using Angular Material. To guide me, I found this helpful example here. Here is the progress I have made so far: HTML <mat-form-field> <input matInput (keyup)="applyFilter($event.target.value)" placeholder ...

The presence of 'touched' within Angular validation is causing a delay in method execution

Upon utilizing this validation method, it became apparent: <label>Password</label> <input type="password" formControlName="password" class="form-control" [ngClass]="{ 'is-invalid': f.password.touc ...

When attempting to send data to the ServiceStack RESTful service, an error message of 'Access is denied' was received

I created a RESTful service using ServiceStack to send data to a database. It worked perfectly when tested locally. However, after deploying it to a server and running the same jQuery $.ajax call code, I encountered an 'Access is denied' error. I ...

Can AngularJS store {{expressions}} by assigning them to a $scope variable?

I am currently working on a Rails application, incorporating AngularJS for certain aspects of the frontend. Can I save {{expressions}} as a value in $scope.variable? Below is the code snippet: Displayed is the Angular controller // Data is retrieved fr ...

Generating a bundle.js from a Bootstrap premade template in Webpack 2: A Step-by-Step Guide

Looking to build a bundle.js file from an existing bootstrap template that uses less? Check out the template I'm working with here. I attempted to generate the bundle.js but ran into issues - styles not being generated and an empty bundle.js in the " ...

Place a list with scrolling and overflow features side by side

Having trouble getting my headers to scroll with overflow auto and white-space nowrap. Can't figure out why it's not working. I want to create hyperlinks within headers to link to specific parts of the website. I have the code for hyperlinking s ...

Backing up PDF files via protractor

When I try to save a PDF file, I run into an issue. After clicking the Print button on my page, it redirects me to a new page with the PDF displayed in a standard Chrome PDF viewer. While this is convenient for users, I am unable to find a way to download ...

The perfect combination: AngularJS with secure HTTPS encryption

I currently have an Angular application set up on a Live server equipped with an SSL certificate. My application makes use of MVC5 + Web API with Individual User Authentication implemented on the server side. To monitor the data being sent over HTTPS, I ...

Error: 'callback is not a function' when using function.apply()

Why is this not working as expected? The error message indicates that typeof(callback) is undefined. function A(a, callback) { document.write(typeof(callback)); callback(); return a; } function Run(func, args) { return func.apply ...

Steps for refreshing the content within a div without having to reload the entire page following an ajax request

I am trying to achieve the task of reloading the content of a specific div on a webpage without refreshing the entire page. My goal is to reload the div after uploading a photo so that the newly uploaded photo can be displayed from the database. However, t ...

Updating the content of a list item on the fly using React

After spending all day on this, I am feeling a bit frazzled. Trying to achieve what would take 20 seconds in JQuery has proven to be quite the challenge in React ¯\_(ツ)_/¯ In my application, tags are ranked by importance from 1 to 9. Simple enoug ...

Fetching data using JSONRequest sample code

I am new to web development and this is my first attempt at using JSON. On the JSON website (http://www.json.org/JSONRequest.html), they recommend using JSONRequest.get for certain tasks. However, I keep running into an error stating "JSONRequest is not ...

Modify an HTML table and record any modifications as POST requests using Javascript

As a beginner in JavaScript and HTML, I am open to corrections if I am not following the correct practices. Recently, I delved into editing an HTML form table. {%extends 'base.html'%} {%block content%} <html> <body> <h4> Search ...

"Retrieve objects from an array based on specified minimum and maximum values, while also checking for any null

My current dataset is structured as follows: const data = [ { id: '11se23-213', name: 'Data1', points: [ { x: 5, y: 1.1 }, { x: 6, y: 2.1 }, { x: 7, y: 3.1 }, { x: 8, y: 1.5 }, { x: 9, y: 2.9 ...

Just starting out with JavaScript - updating the appearance of an element

Based on the value of a boolean, I am looking to control the visibility of specific tabs in my sidebar when the page loads. var someVar = true; function show_ifTrue() { if (Boolean(someVar) == true) { document.getElementById('x'). ...

Unable to open modal in browser due to HTML, CSS, and jQuery issues

I'm having trouble creating a modal window that opens when a button is clicked for user registration. The button is being clicked, but the modal window isn't appearing. Here's my code: <script src="http://ajax.googleapis.com/ajax/libs/ ...