Incorporating Angular module into the mean.io bundle

Need help with adding the angular-ui-grid module to a mean.io package:

$ cd packages/custom/mypackage
$ npm install angular-ui-grid --save

To import the JS, add this line to

packages/custom/mypackage/public/index.js
:

import 'angular-ui-grid';

And include this line in packages/custom/mypackage/app.js:

MyPackage.angularDependencies(['ui.grid']);

The issue is that it imports the JS but not the CSS. How can I bring in the styles as well?

Answer №2

Include the CSS file(s) in your index.html.

For example:

//index.html
<html ng-app>
<head>    
<link rel="stylesheet" type="text/css" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
</head>
...
</html>

Source

Answer №3

Here's a workaround that seems to do the trick:

packages/custom/mypackage/public/index.js

import '../node_modules/angular-ui-grid/ui-grid.min.css';

It gets the job done, but it feels like a bit of a workaround.

I'm wondering if there might be something missing in the angular-ui-grid package definition that specifies the main CSS file, or if this is an issue with mean.io's build system?

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

Setting up access controls for files in Express and NodeJS

Looking for a way to upload files using my express API to a server's filesystem with root owner. Is there a method to specify the file owner and permissions upon upload, like setting owner as 'me' and access as '644'? Here is what ...

Install all package.json dependencies globally using npm

Is there a way to globally install all the dependencies listed in my package.json file? When I run the command npm install -g, it seems to only install the dependencies locally. Any suggestions on how to achieve global installation? ...

At times, the loading image fails to appear on Ajax

Take a look at my code below: function apply_image_effect(){ $.ajax({ url: "image/image.php", global: false, type: "POST", data: ({my_color:encodeURIComponent($('#my_color').val()),my_size:$('#my_size&apos ...

How can I locate specific images within a CSS sprite?

Are you searching for the correct process to pinpoint specific image locations within an image sprite? If, for example, you aim to create 10 div images in your header using the image provided below, how can you determine the exact location of each one? Is ...

Guide to setting the radio_button checked for the first child element in Rails 4

Currently, I am working with rails4 and have encountered an issue related to a dropdown list. My goal is to automatically select the radio_button of the first child element when a parent item is chosen from the dropdown menu. Essentially, the dropdown cons ...

Removing a jQuery class while simultaneously adding it to different elements

I am currently working on a webpage where I have a row of 6 images. The first image, when the page loads, undergoes transformations using CSS3 due to a specific class applied to it. When the user hovers over the other images in the line, the same class is ...

Developing a sliding menu with AngularJS

Currently, I am developing an AngularJS application. One of the features I am working on involves having a menu at the top of my page that, when an item is selected, will slide down to reveal content specific to that selection in the same area as the menu. ...

Issues with the functionality of customisable list items in a list

I am attempting to customize the appearance of specific list items within a ul element. One li element should be displayed in red font, while another li element should have a hyperlink styled with a different color and an underline rollover effect. The thi ...

Issue with accessing child property in AngularJS Service: Unable to retrieve the property value

I have developed a service to retrieve the user details upon logging in, which I intend to distribute to all Angular controllers: var app = angular.module('myApp', ['ui.calendar', 'ui.bootstrap']); app.service('authUser ...

jQuery prioritizes enforcing style over using a CSS file

I am facing an issue with a nested div functioning similar to a drop-down menu. The problem arises when I click on the #two div as I want it to disappear. To handle this, I utilized jQuery and tried using both .hide() and .slideUp(). However, upon implem ...

Is there a way to transfer JavaScript data to PHP?

<div> <p>This is a sample HTML code with JavaScript for tallying radio button values and passing them to PHP via email.</p> </div> If you need help converting JavaScript data to PHP and sending it via email, there are v ...

Adjust CRM 2011 settings to allow bulk editing exclusively for specific entities

Currently, my goal is to restrict bulk editing for most entities except for the "Campaign Response" entity. To accomplish this task, I have taken the following steps: Disabled the Out of the Box (OOTB) edit button globally (due to restrictions on editin ...

The JSON output is throwing an error because it is unable to access the property '0' since it is

Trying to convert JSON data into an HTML table, I encountered the following error: "Cannot read property '0' of undefined" <?php $idmatchs = "bGdzkiUVu,bCrAvXQpO,b4I6WYnGB,bMgwck80h"; $exploded = explode(",", $idmatchs); $count = count( ...

Unfortunate Outcome: CSS Request Results in 404 Error

Recently, I made a transition from having a single-page website to using an express server for my website. During this process, I had to modify the file paths. However, I am encountering difficulties in loading my css and js files. Upon inspecting the dev ...

Guide on creating a square within an element using JavaScript

After conducting thorough research, I find myself unsure of the best course of action. My situation involves a Kendo Grid (table) with 3 rows and 3 columns. Initially, the table displays only the first column, populated upon the page's initial load. S ...

Can you please guide me on how I can implement a top AJAX menu like the one on StackOverflow

Have you seen the menu that appears when you first visit a website, with an 'x' on the right to close it? I believe this is done through AJAX - what specific terms should I look up to implement this feature? ...

Is it possible to utilize a JavaScript variable in this particular scenario and if so, what is the

let myVariable = <?php echo json_encode($a[i want to insert the JS variable here]); ?>; Your prompt response would be highly valued. Many thanks in advance. ...

I am having trouble initializing npm due to an error

I am currently working on a Node.js project but I am having trouble starting Node.js. In my existing Angular project, and after creating a new project with the following commands: sudo npm install -g @angular/cli After that, run: ng new mean-angular5 ...

Aligning Text Vertically with an Image in ul/li List Items

Apologies if this question has already been asked, but I've checked several similar inquiries in an attempt to merge the solution without much luck. I currently have a bootstrap row with two col-md-6's. The first column contains an image, while t ...

Trouble with placing an absolutely positioned element using Tailwindcss

I am currently working on a project using TailwindCSS in which I have a logo positioned to the left and navigation to the right. Both elements are centered, but because the logo has a position of absolute, it appears in front of the navigation. I would lik ...