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

Make sure the header spans the full width of the body

I am trying to create a header that spans the entire width of the body, but I am encountering some issues with white space on both sides. I initially attempted to set the width to 100% on the header div, but this did not eliminate the white space. I then e ...

swap out the CSS class for my own class dynamically

When I display HTML code like this <div class="btn btn-pagination"> <i class="fa fa-angle-right"></i> </div> and want to replace fa fa-angle-right with myClass when the page loads. I attempted: $(document).ready(function () { ...

Easily validate the contenteditable attribute of <td> element

I am currently working on a table that displays data from a MYSQL database. Whenever a user makes changes to an element in the table, I want the database to be updated using AJAX. Below is my JavaScript code for sending data in an editable row. function s ...

Issue with ui.router not functioning correctly with dual views

I am having trouble with ui.router as my views are not displaying properly. When I navigate to /manageservices, the content in the left and right html files does not show up on the page. My goal is to have a left and right view displayed on the page. < ...

Run JavaScript on every website when the page loads

After loading all or specific pages in the browser, I am looking to run JavaScript code (predefined code). Are there any browsers and plugins/components that allow me to achieve this? The manual method involves opening the console (e.g. firebug) and execu ...

A guide on setting up a countdown timer in Angular 4 for a daily recurring event with the help of Rxjs Observable and the Async Pipe

I'm currently working on developing a countdown timer for a daily recurring event using Angular 4, RxJS Observables, and the Async Pipe feature. Let's take a look at my component implementation: interface Time { hours: number; minutes: numbe ...

Preventing a webpage's CSS from affecting an iframe loading an HTML document

Whenever I load an iframe, it seems to change a bit. Do I need to apply some kind of reset or adjustment? How can I ensure that the content within the iframe looks consistent no matter what page it's loaded into? ...

Hide jquery scroll bar

I am currently working on a WordPress plugin with the Twenty Thirteen theme. My goal is to display a modal when a div is clicked, and at that time I want to hide the scrollbar on the body of the page. Despite trying the following code snippet, it doesn&ap ...

How can one ensure the preservation of array values in React?

I'm struggling to mount a dynamic 'select' component in React due to an issue I encountered. Currently, I am using a 'for' loop to make API calls, but each iteration causes me to lose the previous values stored in the state. Is t ...

What is the best way to create an HTML5 Range that gracefully degrades?

I want to incorporate the <input type='range' /> element from HTML5 for modern browsers and fallback to a <select /> if needed. Since I am working with Ruby-on-Rails, as a last resort, I could implement something similar to this on th ...

What is the method for reaching a service in a different feature module?

Currently, I am utilizing Angular 2/4 and have organized my code into feature modules. For instance, I have a Building Module and a Client Module. https://i.stack.imgur.com/LvmkU.png The same structure applies to my Client Feature Module as well. Now, i ...

Is it possible for jQuery to execute in a sequential manner?

Below is the code I am working with: https://jsfiddle.net/c4zquo60/1/ CSS: #bg { background-repeat: no-repeat; position: absolute; top:0; bottom:0; left:0; right:0; width:100wh; height:100vh; z-index: -1; opacity: ...

Error: Unexpected end of argument list in file c:/.../list.ejs during ejs compilation

Hello, I am a beginner in programming and I have been working hard to learn. Unfortunately, I encountered a SyntaxError: missing) after argument list in c://.../list.ejs while compiling ejs error and I am struggling to find the solution. I am reaching out ...

Update the image and heading simultaneously when hovering over the parent div

I am looking to enhance the user experience on my website by changing the color of headings and images when a user hovers over a specific section. Currently, I have been able to achieve this effect individually for each element but not simultaneously. Any ...

What is the reason behind modern browsers continuing to add spaces between inline blocks when there is whitespace present?

Consider the following HTML markup: <div class="inlineblock">one</div> <div class="inlineblock">two</div> <div class="inlineblock">three</div> Accompanied by this CSS style: .inlineblock{ display: inline-block; } ...

The $emit method in Vue seems to be ineffective when used on the parent component, yet it functions properly when used on the

I have a component called "register" which contains an event listener @submit.prevent inside the template, and I am using $emit to send the data. When I console.log within the method of the component itself, it works fine. However, when I try to access the ...

How to choose between AWS.DynamoDB and AWS.DynamoDB.DocumentClient for your specific use case?

As I delve into learning DynamoDB and the AWS serverless stack, I've noticed that many tutorials recommend using AWS.DynamoDB.DocumentClient. This is exemplified by the following code snippet used to create an item: const dynamodb = new AWS.DynamoDB. ...

Unravel a series of encoded messages using protobuf.js

Within our node.js application, the task at hand involves deserializing a Buffer that we are aware contains multiple objects. In the past, utilizing protobuf-net, this process was carried out in the following manner: var stream = new MemoryStream(byteData ...

Managing the width of an HTML table column based on its text content dynamically

Here is an example of an html table : <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="480px" class="societe" ><div style="float:left;font-size:12px;padding-top:2px" ><?php echo $_SESSION ...

Avoid special characters (metacharacters and diacritical marks)

When my program consumes data from an API, it receives the following output: "<a href=\"http:\/\/www.website2.com\/\" target=\"_blank\">Item card<\/a>","<img src=\"https:\/\/website.com ...