The functionality of ng-repeat is not functioning as expected when used with ng-include

I have encountered an issue while using a Select class that I found on the Internet. When I dynamically create options in the Select using Angular's ng-repeat, the options are not clickable. However, if I manually create the options with dynamic values, they can be clicked.

Here is the code snippet:

MainFile :

...
   <div id="SiteList" ng-controller="SiteController as siteCtrl" ng-if="masterCtrl.isUserLogged()" ng-include="'Select2/index.html'" ng-init="siteCtrl.getSites()">
...

This is Select2/index.html ...

<body>
  <div class="drop">
  <div class="option active placeholder" data-value="placeholder">
    Select a site
  </div>
  <div class="option" ng-repeat="sito in siteCtrl.siti"  data-value="{{sito.name}}">>{{sito.name}}</div>

</div>
  <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>

  <script src="Select2/js/index.js"></script>

</body>

...

Then the Select2/js/index.js

 $(document).ready(function() {
  $(".drop .option").click(function() {
    var val = $(this).attr("data-value"),
        $drop = $(".drop"),
        prevActive = $(".drop .option.active").attr("data-value"),
        options = $(".drop .option").length;
    $drop.find(".option.active").addClass("mini-hack");
    $drop.toggleClass("visible");
    $drop.removeClass("withBG");
    $(this).css("top");
    $drop.toggleClass("opacity");
    $(".mini-hack").removeClass("mini-hack");
    if ($drop.hasClass("visible")) {
      setTimeout(function() {
        $drop.addClass("withBG");
      }, 400 + options*100); 
    }
    triggerAnimation();
    if (val !== "placeholder" || prevActive === "placeholder") {
      $(".drop .option").removeClass("active");
      $(this).addClass("active");
    };
  });

  function triggerAnimation() {
    var finalWidth = $(".drop").hasClass("visible") ? 22 : 20;
    $(".drop").css("width", "24em");
    setTimeout(function() {
      $(".drop").css("width", finalWidth + "em");
    }, 400);
  }
});

Does anyone have any suggestions on how to fix this issue?

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

Adding JSON objects to an HTML body with pure JavaScript - no need for jQuery!

I have my website content stored in a 'content.json' file, resulting in an empty body in my HTML index. Currently, I am able to console.log all the elements from 'script.js' and view all the divs declared in 'content.json' wit ...

Unable to retrieve post information from Angular using PHP

I've hit a roadblock in my Angular App where I can't seem to access the body of the post data being sent from Angular 4. Despite numerous attempts, I'm unable to retrieve this crucial information. Can anyone lend a hand in identifying the is ...

What is the method for calculating the total number of keys in an object to assess an equation

I am attempting to conceal the parent element of a table (which has rows generated using ng-repeat) if the table does not contain any data. A solution I came across specifies this scenario for arrays, as shown in the example below: However, my situation i ...

How to extract cookie value in a node.js application using socket.io

How can I retrieve cookie values in a node server using socket.io? Whenever a socket sends a message to the server, I need to check the value of the cookie. However, I only want to obtain the cookie value and not the session cookie as done in Express. r ...

Using Google Maps API to combine geoJSON properties with fixed text in an infobox

I've been working on a GoogleMaps project where I load geoJSON points and display their "waterlevel" property in an info-box when hovering over a point. However, I want the info-box to show "Water Level = #" instead of just "#". So far, I've man ...

Monitoring Changes in Properties Using AngularJS Watch Service

I need to display a simple download progress for my app. As each file is successfully downloaded, I want to show the user the total number of downloads completed out of the total number of files to be downloaded. For example, 1/5, 2/5, 5/5. The download pr ...

What could be causing the incorrect updating of React State when passing my function to useState?

Currently, I am in the process of implementing a feature to toggle checkboxes and have encountered two inquiries. I have a checkbox component as well as a parent component responsible for managing the checkboxes' behavior. The issue arises when utiliz ...

Incorporating image hyperlinks onto a designated webpage within a JavaScript presentation carousel

Working on an e-commerce website, the client has requested 3 slide shows to run simultaneously displaying specials or promotions. I have successfully set up the 3 slide shows next to each other, but I'm unsure how to incorporate image links that direc ...

What type of pop up modal can be implemented in the application that utilizes ui-router?

My webpage includes various pages that are accessed through the UI-router, each with different states and modules integrated using ng-include. I now need to incorporate a popup modal into my webpage, but the current modal is not functioning as desired. A ...

What could be causing the shadow to appear misplaced in Three.js?

I have a blue car and a yellow sphere on top. The source of light is coming from above. Why does the shadow appear in the wrong spot? Code: http://jsfiddle.net/kLmn9/ Edit: When I adjust the light.shadowBias, the shadow on the ground becomes accurate, b ...

Troubleshooting ReactJS and Webpack: Understanding the Uncaught Error when Module "../media/interiorTest.jpg" Cannot be Found

I am currently working with Webpack and ReactJS, trying to fetch an image and display it. However, I keep encountering the error message: Uncaught Error: Cannot find module "../media/interiorTest.jpg" Here is the code snippet that I have attempted: <d ...

Spotify API encountered an issue with the data structure conversion: TypeError - Unable to convert circular structure

Encountered an error message Uncaught (in promise) TypeError: Converting circular structure to JSON while attempting to execute my code. Despite researching the error code, all solutions seem to revolve around a circular reference problem. However, I am ha ...

Converting an array to PHP and fetching the values

Seeking assistance as I am struggling to find a solution. I have a JavaScript array that needs to be passed to a PHP script in order to store all the values (maximum of 3) on Session variables. The JavaScript array is generated from a string.split function ...

What is the solution for - Uncaught TypeError: Cannot access the property 'scrollHeight' of an undefined element?

Could someone kindly assist me in resolving an issue? I recently encountered a problem with a script I have been using on the Chrome console. This script has been working perfectly fine for the past few days. However, today when I ran it, I started receiv ...

How can one accurately pair the key and its corresponding value from an array of objects to create a new object containing only that key?

In my JavaScript code, I am attempting to create a function that can match a specific key with an array of objects fetched from an API. This matching process is based on two parameters obtained from the API: a key (which is a string) and an array of object ...

Include a song in a playlist using Spotify's API on the web

When attempting to add a track to a collaborative playlist, I encountered an issue with the access token implementation. $credentials = 'client_id:client_secret'; $headers = array( 'Accept: */*', 'Content-Ty ...

Retrieve and save only the outcome of a promise returned by an asynchronous function

I am currently working on an encryption function and have encountered an issue where the result is returned as an object called Promise with attributes like PromiseState and PromiseResult. I would like to simply extract the value from PromiseResult and s ...

It is not possible to display JSON data that has been injected using a service within the amchart directive's datapro

I have incorporated amcharts into my custom directive. Now, I need to retrieve the dataProvider for this AmChart from the output of the $http.get service using web services. Despite my efforts, I am encountering difficulties in dynamically assigning the r ...

Routing with nested modules in Angular 2 can be achieved by using the same

Encountering a common issue within a backend application. Various resources can be accessed through the following routes: reports/view/:id campains/view/:id suts/view/:id certifications/view/:id Note that all routes end with the same part: /view/:id. ...

Adjust total based on checkbox selections

Initially, there is a span that displays the sum of all checkboxes when they are checked. If a checkbox is unchecked, its value should be subtracted from the total sum. However, instead of decreasing the value, it ends up doubling it. For example, if the c ...