Is the internal injector causing compatibility issues with Angular on IE9?

My Angular 1.3.15 application is encountering issues on Internet Explorer 9. An error message

Unable to get property 'replace' of undefined or null reference
is pointing to a specific block of code within the angular core.

The function in question seems to be executing correctly, but I am unsure about its intended purpose and what might be missing for it to work properly on IE9.

function createInternalInjector(cache, factory) {

    function getService(serviceName, caller) {
      if (cache.hasOwnProperty(serviceName)) {
        if (cache[serviceName] === INSTANTIATING) {
          throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
                    serviceName + ' <- ' + path.join(' <- '));
        }
        return cache[serviceName];
      } else {
        try {
          path.unshift(serviceName);
          cache[serviceName] = INSTANTIATING;
          return cache[serviceName] = factory(serviceName, caller);
        } catch (err) {
          if (cache[serviceName] === INSTANTIATING) {
            delete cache[serviceName];
          }
          throw err;
        } finally {
          path.shift();
        }
      }
    }

In an effort to resolve this issue, I have already included es5-shim and shams, as well as utilized data-ng-* attributes. Despite researching solutions for making Angular work on IE9, I have not come across a similar problem, hence seeking assistance on Stack Overflow.

Answer №1

After meticulously adding breakpoints and debugging, I was able to pinpoint the issue with the service injection failure of $location. It turns out that this problem originated from my attempt to enable html5 mode:

$locationProvider.html5Mode(true).hashPrefix('!');

By simply commenting this line and resorting to using # routes, the application seems to be functioning properly. However, if anyone knows how to implement html5mode in IE9, please share your insight so that I can acknowledge your solution as the correct one instead of answering my own question.

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

issue with integrating promise in angular 4

I'm currently learning about promises and how to implement them in Angular. I have written the following code in StackBlitz. My goal is to display the array whenever it contains a value by using promises in Angular. This is my HTML code: <h2>A ...

In Javascript, async functions automatically halt all ongoing "threads" when a new function begins

I have a dilemma with multiple async functions that can be called by the user at any point in time. It is crucial for me to ensure that all previously executed functions (and any potential "threads" they may have initiated) are terminated when a new functi ...

Decode a JavaScript string without the need to save it as a file

Imagine a situation where I allow a client to input a JavaScript script that needs to be sent to my server. This script is meant to export an object. Here is the frontend code snippet: <form action="/blabla.js" method="post"> ...

Guide on passing promises from controller to directive within AngularJS by utilizing $resource

I am eager for the promise to be returned from the controller to the directive, allowing me to alter the template based on the received promise. LoginController : (function() { angular.module('nd') .controller('LoginController', ...

The ng-model may fail to update during certain change events

Implementing the Angular chosen-select, I have tailored it to support dynamic loading by fetching data from the server. An issue arises when I unselect a value - although it removes it from the selected items, it fails to update the ng-model. Interestingl ...

A Guide to Implementing v-for in a JSON Array with Vue.js

After receiving JSON data from the server: [ {"id":"2","name":"Peter","age":"24"}, {"id":"4","name":"Lucy","age":"18"}, ] I am ...

Steps to resolve the error message 'npm ERR! Cannot read property 'startsWith' of null':

As I embark on creating my very first react-native app, I encountered a stumbling block while trying to set up the react-native command line interface following the instructions provided here. Every attempt I make to initialize the react-native command lin ...

Creating unique reusable Angular components with dynamic attributes similar to React's props

I am looking to create a custom component that will allow me to insert content inside the opening and closing tags, which will be placed exactly where I want it within my HTML code. Here is an example of what I am trying to achieve: <my-custom-compo ...

AngularJS - Implementing toggle functionality for checkbox on button click

Here's my situation: I have a group of checkboxes that are initially disabled. When button 1 is clicked, I want the checkboxes to become enabled and buttons 2 & 3 to appear while hiding button 1. If buttons 2 or 3 are clicked, I want to disable the c ...

Access php variable within JavaScript

My current project involves mostly PHP coding, but there is one function that requires me to use JavaScript. The challenge I'm facing is figuring out how to access a PHP variable within my JavaScript code. Here is the snippet I have placed between the ...

Angular 2 - Changes in component properties not reflected in view

I'm currently delving into Angular 2 and as far as I know, interpolated items in the view are supposed to automatically update when their corresponding variable changes in the model. However, in the following code snippet, I'm not observing this ...

Tips for displaying a jQuery error message when a key is pressed

I am working with a textarea that has a word count limit of 500. I need to display an error message below the textarea if the word count exceeds 500. I have successfully calculated the word count, but I am unsure how to display the error message and preve ...

Guide on setting up the installation process of Gulp jshint with npm?

Having trouble with the installation of JSHint. Can anyone point out what I might be doing incorrectly? This is the command I am using: npm install --save-dev gulp-jshint gulp-jscs jshint-stylish Getting the following error message: "[email protect ...

The onchange functionality is not functioning as expected

I've added an onchange event to the select box, but it doesn't seem to be working. Any suggestions would be greatly appreciated. Thank you in advance. HTML [<select id="notifyBy" ng-change="selectchange()" style="border:none" class="formtex ...

What could be causing the consistent Mocha "timeout error" I keep encountering? Additionally, why does Node keep prompting me to resolve my promise?

I'm encountering a timeout error repeatedly, even though I have called done(). const mocha = require('mocha'); const assert = require('assert'); const Student = require('../models/student.js'); describe('CRUD Tes ...

Enhancing the appearance of input range sliders using before and after elements for custom styling

I'm looking to create something similar to the image linked below https://i.sstatic.net/Czef9.png Note:: The above image features a V-shaped icon, which is what I'm aiming for. Currently, I am utilizing input[type="range"]. The foll ...

Transform Client - Server command-line interface Node.js application into a Docker container

My Node.js application consists of two separate components: an Express.js server and a CLI built with vanilla JavaScript and inquirer.js. These components communicate with each other through a REST API. The main reason for this setup is to adhere to the SO ...

Tips for organizing a date with d3's time.format

This JSFiddle and the snippet provided below demonstrate the usage of the format "%d-%b-%y" for dates. The code example showcases how to work with dates in this format, such as "1-May-12". "%d-%b-%y" Here is a sample code snippet: var margin = { top ...

How come I am getting the desired section from my split string only after running the function twice?

I've been working on a function that retrieves data from a form and sends it to a POST request, which in turn sends it to my MongoDB database. The following code snippet showcases the process of uploading an image to IPFS, extracting the IPFS hash fro ...

Is there a foolproof method to confirm the validity of this string as JSON?

I am currently developing an application that requires a function to validate whether a given string parameter is valid JSON. The challenge lies in handling JSON data copied from Jira. For example, the JSON might appear as follows: "{ "query& ...