The interface vanishes upon the integration of TinyMCE into the module

Currently, I am working on a project using Angular-fullstack and attempting to integrate ui-TinyMCE. However, I encountered an issue when I made the following changes:

angular.module('academiaUnitateApp')
  .controller('NewEntryCtrl', function ($http, $scope, $stateParams, entryService, Auth) {
    $scope.entry = {};
  });

to

angular.module('academiaUnitateApp', ['ui-tinymce'])
  .controller('NewEntryCtrl', function ($http, $scope, $stateParams, entryService, Auth) {
    $scope.entry = {};
    $scope.tinymceOptions = {};
  });

After these modifications, my interface changed unexpectedly.

As shown above,

I'm not sure what mistake I might have made. Can anyone provide insight?


The HTML structure in question is as follows:

<div>
    <h1>
        New chapter
    </h1>

    <form class="form" name="form" ng-submit="save(form)" novalidate>
        <div class="form-group">
            <label class="sr-only" for="title">Title</label>
            <input class="form-control" name="title" type="text" placeholder="enter title here" required ng-model="entry.title" />
        </div>

        <div class="form-group">
            <select required ng-model="entry.language">
                <option disabled>Choose language</option>
                <option ng-repeat="e in languages" value="{{e._id}}">{{e.name}}</option>
            </select>
        </div>

        <div class="form-group">
            <label class="sr-only" for="content">Content</label>
            <textarea ui-tinymce="tinymceOptions" ng-model="entry.content" id="textarea" name="content" ></textarea>
        </div>

        <button type="submit" class="btn btn-success" id="save-btn"><span class="glyphicon glyphicon-ok"></span> Save</button>
    </form>
</div>

<hr>

<div>
    <h1>{{entry.title}}</h1>
    <br/>
    {{entry.content}}
</div>


I have added ui-TinyMCE to the list of dependencies in my bower file.

bower.json

{
  "name": "academia-unitate",
  "version": "0.0.0",
  "dependencies": {
    "angular": ">=1.2.*",
    "json3": "~3.3.1",
    "es5-shim": "~3.0.1",
    "jquery": "~1.11.0",
    "bootstrap": "~3.1.1",
    "angular-resource": ">=1.2.*",
    "angular-cookies": ">=1.2.*",
    "angular-sanitize": ">=1.2.*",
    "angular-bootstrap": "~0.11.0",
    "font-awesome": ">=4.1.0",
    "lodash": "~2.4.1",
    "angular-socket-io": "~0.6.0",
    "angular-ui-router": "~0.2.10",
      "angular-ui-tinymce": "*"
  },
  "devDependencies": {
    "angular-mocks": ">=1.2.*",
    "angular-scenario": ">=1.2.*"
  }
}

Answer №1

['ui-tinymce'] needs to be changed to ['ui.tinymce']

It appears that you are incorrectly adding ui.tinymce in the code. You should be retrieving the module instead of recreating it. Refer to https://docs.angularjs.org/guide/module#creation-versus-retrieval.

In your Angular fullstack application, check your /client/app/app.js file:

angular.module('demoApp', [
  'ngCookies',
  'ngResource',
  'ngSanitize',
  'btford.socket-io',
  'ui.router',
  'ui.bootstrap'
])

You need to include ui.tinymce here:

angular.module('demoApp', [
  'ngCookies',
  'ngResource',
  'ngSanitize',
  'btford.socket-io',
  'ui.router',
  'ui.bootstrap',
  'ui.tinymce'
])

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

Execute the script using ajax

Is it possible to execute JavaScript within an AJAX request? I attempted to include some JavaScript code in the PHP file that was called by an AJAX command. The purpose of this script was to modify an HTML attribute on the parent page. However, it did not ...

Missing RequestVerificationToken value when hiding HTML element using jQuery

I am encountering an issue with my ASP.NET MVC 4 form that involves checkboxes being used to show and hide certain HTML elements. When I initially visit the form page, the RequestVerificationToken value is correctly created as a hidden field. Some HTML ele ...

Efficient AJAX validation using PHP and JavaScript

I am currently working on a small website project that requires User registration functionality. One key aspect is ensuring that the system prevents users from registering with usernames that are already in use. Most modern websites employ AJAX to verify ...

Holding out for a callback response in AngularJS / Ionic is key

Is there a way to delay the return of the result until after receiving a callback response? I am working with Ionic and AngularJS. ...

What is the best way to incorporate multiple conditions within a React component?

When working in React, I have the ability to conditionally render any div using the following code snippet: {hasContent && <span>{value}</span> } Recently, I attempted to include two conditions as follows: {hasContent || hasDesc &am ...

Using strings "true/false/null" in React Map render instead of true/false/null values

Imagine working in React, where I am looping through JSON data stored in the state variable this.state.searchData. Some of the data values returned from the API call may include true, false, or null. Here is an example: "active": true, "partition": n ...

Adjust the size of an image within a canvas while maintaining its resolution

My current project involves using a canvas to resize images client-side before uploading to the server. maxWidth = 500; maxHeight = 500; //handle resizing if (image.width >= image.height) { var ratio = 1 / (image.width / maxWidth); } else { var ...

Unable to access URLs manually

Each time I try to enter a url manually into my browser for an Angular-based website, I always encounter the following error: 'HTTP 404 The resource cannot be found Requested URL: /register' The only functional url is http://localhost:XXXX/in ...

Dividing ReactJS into different assemblies

I have a flexible .NET application that utilizes plugins to load controllers, views, and components from different assemblies. I am interested in learning React (completely new to me) and I have a question. Can React split its components into separate as ...

JavaScript Selenium code encountering an "Element not interactable" error with input textbox element

Currently, I am attempting to utilize Selenium in order to automate inputting a location into the search bar on weather.com. Initially, I wrote the code in Python and it seems to be functioning properly: // this works driver = webdriver.Chrome(ChromeDriver ...

Utilizing Node.js and Express.js to Parse HTML Form Inputs

Having trouble extracting input from an HTML form and utilizing it in Node.js. Here is the HTML form being used: <form action="/myform" method="POST"> <input type="text" name="mytext" required / ...

Confirm Submission Issue in HTML Form

During my testing of the blacklist confirmation dialog, I encountered an issue where clicking the OK button did not submit the form as expected. Instead, it seemed to be stuck in a loop where clicking the button had no effect and the dialog remained on scr ...

Achieving Vertical Centering of Text in Bootstrap 5 Buttons with Flex Box to Prevent Overlapping Icons

How can I prevent the text on a Bootstrap 5 button with horizontally and vertically centered text, along with a right aligned icon, from overlapping when it wraps? Additionally, how do I ensure that the icon stays vertically centered when the button text w ...

Tips for utilizing global functions in VUE 2 CLI crowd

I have multiple components that require the same functions. Is there a way to avoid duplicating the code in each component and instead use it globally...? Even if I put the function in the App.vue, it still isn't accessible in the components. ...

Is it possible to share an .ics file using SparkPost in a Node.js environment?

Attempting to generate an i-cal event and link it to a sparkpost transmission in the following manner: const event = cal.createEvent({ start: req.body.a.start, end: req.body.a.end, summary: req.body.a.title, description: req.body.a.body, ...

How can I invalidate the Authorization header in a request?

After delving into the Basic Authentication algorithm and successfully implementing it, I've encountered an issue. The Authorization header in the request seems to never expire, allowing the client to continuously access protected content without re-a ...

Error message: Issue with TypeScript and cleave.js - 'rawValue' property is not found on type 'EventTarget & HTMLInputElement'

I am encountering an error with the onChange event while implementing cleave in typescript. TypeScript is throwing an error indicating that 'rawValue' is not present in event.target. Here is my code: import React, { useCallback, useState, useEff ...

Unleash the power of a module by exposing it to the global Window object using the dynamic

In my development process, I am utilizing webpack to bundle and manage my TypeScript modules. However, I am facing a challenge where I need certain modules or chunks to be accessible externally. Can anyone guide me on how to achieve this? Additional conte ...

Storing values globally in NodeJS from request headers

What is the most effective way to store and access the value from a request header in multiple parts of my application? One approach could be as shown in the following example from app.js: app.get('*', (req, res) => { global.exampleHeader ...

The first name of the user is not shown following the completion of the registration

I'm currently developing an application using React and Node.js. In the frontend, I have implemented a functionality where upon logging in, users are redirected from the /login route to the root route and greeted with their first name. However, when a ...