What is the best way to extract the value from a textangular editor within an ng-repeat loop

I am using the TextAngular editor within an ng-repeat loop.

Within the HTML

<ul ng-repeat="lecture in section.lectures">
    <div class="col-md-12 article-show"  >
        <form ng-submit="lecture_content('article', $index + 1, lecture.id)" style="width:100%;">
            <div text-angular id="lecture_text{{lecture.id}}" ng-model="htmlVariable[lecture.id]" style="width:100%;" ></div>
            <button type="submit" data-toggle="modal" data-target="#stext"  class="sub-sub-section-add">Submit</button>
        </form>
    </div>
</ul>

Within the Controller

$scope.lecture_content = function(type, value, x) {
    
    if (type == 'article') {
        console.log($scope.htmlVariable[lecture.id]);
        var lecture_description = document.getElementById('lecture_text' + x).value;
    }
}

I believe the issue lies within the controller. How can I access the value in the text editor? Thank you in advance.

Answer №1

$scope.view_lecture=function(category,item,index) 
{
    if (category == 'blog')
    {
        var index = this.htmlContent[id];
    }

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

React-scripts testing now displays error messages without a traceback

After recreating the browser version of the TacticToy game using React, I encountered an issue while writing unit tests. The problem is that there is no complete traceback provided for a custom exception, with only the test function being highlighted: htt ...

Generating and saving a PDF file using a binary string in JavaScript or TypeScript

A server response to an Axios request contains the content of a PDF as a binary string. export const fetchPDFfile = async (id: string): Promise<string> => { const { data } = await http.get<string>(`${baseUrl}/${id}.pdf`); return data; } ...

Difficulty keeping the dropdown menu open in bootstrap 4

I am facing an issue with my dropdown menus. I want them to only toggle open or close when the dropdown menu itself is clicked, not when any of the list items or other parts of the page are clicked. Below is the code snippet that is causing the problem: ...

Exploring the directories: bundles, lib, lib-esm, and iife

As some libraries/frameworks prepare the application for publishing, they create a specific folder structure within the 'dist' directory including folders such as 'bundles', 'lib', 'lib-esm', and 'iife'. T ...

I am having trouble having a select component populate with new child components while still maintaining its original value

So here's the situation. Let me simplify things for you. I'm in the process of developing an app that generates JSON queries to be sent to a server. The query-building components are structured in a nested manner: QueryContainer > QueryGroup ...

Out of the blue div, could you lend your assistance?

I have a code that displays 5 random images with corresponding text. My challenge is that I want to separate the text into another div so that I can add another function to it, while still keeping the images random with their corresponding text. <scr ...

Utilize javascript to activate the hyperlink

Clicking the following link will open a video: <a href="<?php echo $rows['image1'] ; ?> " rel="vidbox" title="<?php echo $rows['name']." <br>".nl2br($rows['detail']) ; ?>" id="m2"><?php ...

An effective method for excluding null values with an Angular pipe

I am currently working on an Angular pipe that filters results based on user input. The problem I'm encountering is that some of the results do not have a value, resulting in this error message: Cannot read property 'toLocaleLowerCase' o ...

SQL query encountering issue after introducing apostrophe symbol ''`

SELECT CONCAT ( schoolname ,CASE WHEN schoolcity IS NULL OR schoolcity = '' THEN '' ELSE (', ' + REPLACE(schoolcity, 'ã', 'a')) ...

The functionality of Express JS routers is experiencing issues

As I delved into learning nodejs and express, I decided to create a basic router. Initially, everything seemed to be working fine, but upon reopening the project, I encountered an issue. var express = require('express'); var app = express(); var ...

Need assistance using a form within a popover in Angular UI Bootstrap?

I have implemented a button that triggers an Angular UI Bootstrap popover by using a template. If you want to see it in action, you can check out this demo The popover template consists of a form containing a table with various text fields that are bound ...

Create an interactive JSON tree structure

I am looking to create a JSON tree from an array. My array is structured like this: var arraySource = []; arraySource.push({key : "fr", value: "france"}); arraySource.push({key : "es", value: "spain"}); //... console.debug(arraySource); The desired JSON ...

How can I access the result of a getJSON promise within the $.when method?

I am working on a piece of code where I aim to collect data from 2 getjson calls and store it in an array only when both calls have successfully completed. However, I encountered the following error: resultFromUrl1.feed is undefined var entry1 = resultFro ...

Develop a form that relies on multiple requests made through AJAX

I am attempting to create a form that requires 2 ajax calls. The first call retrieves information about a ranking that is then displayed in the form using the following code: $.ajax({ method: "GET", url: base_url + "/ranking/getranktoedit/" + rank ...

Is it possible to utilize AngularJS translate alongside Angular UI Router?

Just starting with Angularjs and keen to integrate angular-translate into my project Check out the site below After referring to its documentation, I encountered an error Uncaught TypeError: Cannot call method 'useStaticFilesLoader' of undef ...

The issue with knockoutjs and isotope is that the new item being added causes the first element to move erratically

Currently utilizing knockoutjs along with the isotope masonry layout, incorporated with a custom binding referring to the code blog link provided here: Snippet from the View: <div id="container" class="isotope" data-bind="foreach: bills"> <d ...

Guide to adding content at a particular location using the ACE Editor from within an Angular Controller

I am currently developing a real-time collaborative editor using the Ace editor library, but I am facing challenges with inserting text at a specific position within the editor. Specifically, I am looking to insert text at the cursor position when the use ...

The correct usage of && and || operators in javascript

I've developed a small web application and I'm facing an issue where I want to trigger an alert when the 'enter' key is pressed if there is an empty or space value. Currently, the alert appears not only on hitting 'enter' but ...

What is the best way to separate one dropdown area from another dropdown area?

I have two dropdown menus where, when an option with the value "other" is clicked, it generates a text area just below the dropdown menu. Both sections are functioning correctly, but I had to create separate parent wrappers for each in order to do so. How ...

Struggling to establish a functioning proxy in my React and Node application

In the process of developing a react client app with a node.js express backend, I have encountered an issue related to project structure. https://i.sstatic.net/8rID0.png The client app includes a proxy configuration in its package.json file: "proxy": "h ...