!stwKHgRhngEqycqwry:matrix.org

Angular-cli

4294 Members
Angular cli10 Servers

Load older messages


SenderMessageTime
5 Nov 2020
@gitter_derekkite:matrix.orgDerek (Gitter) https://www.digitalocean.com/community/tutorials/angular-shortcut-to-importing-styles-files-in-components @michael-letcher this might give some ideas 05:41:09
@gitter_michael-letcher:matrix.orgMichael Letcher (Gitter)

@derekkite Thanks for the link, the article is focused on importing styles, which sadly does not solve my issue.
The problem I face is referencing a font file (found in a NPM package, and added to the app via assets glob), the font LESS file (also via an NPM package, added to the app via Angular's styles)

// font.less
@approach-font-family: 'Approach';
@approach-font-path: '/assets/fonts/approach';

// Approach-Lt
@font-face {
  font-family: '@{approach-font-family}';
  font-weight: 300;
  font-style: normal;
  src: url('@{approach-font-path}/3AAA6B_0_0.eot');
  src: url('@{approach-font-path}/3AAA6B_0_0.eot?#iefix') format('embedded-opentype'),
    url('@{approach-font-path}/3AAA6B_0_0.woff2') format('woff2'),
    url('@{approach-font-path}/3AAA6B_0_0.woff') format('woff'),
    url('@{approach-font-path}/3AAA6B_0_0.ttf') format('truetype');
}

This works just fine when the app is based in the root of server
e.g. http://server.com/

but that app is located one level lower
e.g. http://server.com/app/

So I have to add a base-href='/app/'

Everything works bar the font....

the font is looking up http://server.com/assets/fonts/approach (missing /app/)

05:52:09
@gitter_michael-letcher:matrix.orgMichael Letcher (Gitter)Some solutions mention adding ~ to the start but this causes postCSS in the CLI to throw an error.05:53:06
@gitter_michael-letcher:matrix.orgMichael Letcher (Gitter) (edited) ... ~ to ... => ... ~ or ^ to ... 05:53:16
@gitter_derekkite:matrix.orgDerek (Gitter) can you not do '../assets/' relative to the location of the font.less file? 06:06:44
7 Nov 2020
@apoos_maximus:matrix.orgapoos_maximus joined the room.09:33:23
12 Nov 2020
@gitter_sapendo:matrix.orgSlava Gorban (Gitter) joined the room.21:29:39
@gitter_sapendo:matrix.orgSlava Gorban (Gitter) Hi everyone) I have the next problem:
I try to follow this rule https://angular.io/guide/workspace-config#style-preprocessor-options. Unfortunately, I receive the error during build my project. The error is Schema validation failed with the following errors: Data path "" should NOT have additional properties(stylePreprocessorOptions). Could somebody help me?
21:29:39
16 Nov 2020
@gitter_intellix:matrix.orgDominic Watson (Gitter) joined the room.15:00:24
@gitter_intellix:matrix.orgDominic Watson (Gitter) in the documentation get() says it's like $() in jQuery which is basically querySelector... but if you search the documentation for querySelectorAll there's no results at all. I can't really see how to get an array of elements for my then() to check for a length of elements 15:00:25
@gitter_intellix:matrix.orgDominic Watson (Gitter)the documentation makes it sound like it can return either a single element or an array of them15:05:15
@gitter_intellix:matrix.orgDominic Watson (Gitter) (edited) ... of them => ... of them... but if I do something like elements.length > 1 && elements[0].hasClass it says hasClass doesn't exist on that 15:05:33
@gitter_intellix:matrix.orgDominic Watson (Gitter) (edited) ... on that => ... on that: ```elements[0].hasClass is not a function``` 15:06:02
@gitter_intellix:matrix.orgDominic Watson (Gitter) it seems to be wrapped in some magic or something... still no idea how to use debugger or log anything. I just have to run my entire suite and watch it fail endlessly until it magically works again :'( 15:06:55
@gitter_intellix:matrix.orgDominic Watson (Gitter) if there's 1x element, it seems to be wrapped in some jQuery thing which supports hasClass, but if it's an array of elements then it seems each element is the raw element and I have to use classList.contains? 15:12:47
@gitter_intellix:matrix.orgDominic Watson (Gitter) (edited) ... use classList.contains? => ... use classList.contains? Can I just not return any jQuery-like wrapped things at all? I'd prefer to just know it's not there 15:14:03
@gitter_intellix:matrix.orgDominic Watson (Gitter) cy.get('#something').then(e => e.classList.contains('abc')) // contains of undefined 15:17:39
@gitter_intellix:matrix.orgDominic Watson (Gitter) (edited) ```cy.get('#something').then(e => e.classList.contains('abc')) // contains of undefined``` => ``` cy.get('#something').then(el => el.classList.contains('abc')) // contains of undefined cy.get('li').then(el => el[0].classList.contains('abc')) // works ``` 15:18:12
22 Nov 2020
@gitter_ddubrava:matrix.orgDaniil Dubrava (Gitter) joined the room.19:02:43
@gitter_ddubrava:matrix.orgDaniil Dubrava (Gitter) Good night, can anyone help me with that question, please - https://stackoverflow.com/questions/64957644/angular-library-11-include-index-d-ts-in-build 19:02:43
27 Nov 2020
@magbeat:matrix.orgmagbeat joined the room.10:40:49
7 Dec 2020
@gitter_unsama:matrix.orgunsama (Gitter) joined the room.10:26:06
@gitter_unsama:matrix.orgunsama (Gitter) hello guys this is my router code, index component not found in production build but working on localhost can anyone please help me i am using angular cli version 11

import { Routes } from '@angular/router';
import { IndexComponent } from './index/index.component';

export const appRoutes: Routes = [
  { path: 'index/:id', component: IndexComponent }
];
10:26:06
@gitter_danww:matrix.orgDaniel Willis (Gitter) joined the room.19:07:17
@gitter_danww:matrix.orgDaniel Willis (Gitter) Hey there; are you able to recreate your issue in Stackblitz to share with us? (https://stackblitz.com/) 19:07:19
@gitter_unsama:matrix.orgunsama (Gitter) hello guys this is my router code, index component not found in production build but working on localhost can anyone please help me i am using angular cli version 11

import { Routes } from '@angular/router';
import { IndexComponent } from './index/index.component';

export const appRoutes: Routes = [
  { path: 'index/:id', component: IndexComponent }
];
19:07:39
8 Dec 2020
@gitter_epiehl:matrix.orgepiehl (Gitter) joined the room.22:42:20
@gitter_epiehl:matrix.orgepiehl (Gitter)

Hey everyone, i am having a littile issue in my setup. As i was reading back and forth about LocationStrategies, i switched back to PathLocationStrategy and i am receiving a 404. The issue here is, that is that the code chunks are not loaded from the correct subdirectory. e.g.:

<script src="runtime.js" defer></script><script src="polyfills.js" defer></script><script src="vendor.js" defer></script><script src="main.js" defer></script><!doctype html>
<html lang="en">
<head>

The upper script part is added by ng serve.
My browser now tries to fetch the runtime.js and this works as long as i do not traverse into a subpath. If a append for example /test/1, it will try to load runtime.js from /test/runtime.js, when i reload the page.

I just upgraded from 10.2 to 11 in hopes of being able to fix that. I am also aware of the fact that i have to implement a rewrite in my production env but from what i read, ng serve should be able to deal with page refreshes

22:42:20
@gitter_epiehl:matrix.orgepiehl (Gitter)please ignore my request. seems like i was a little bit off......i didnt have the app-root in a body tag for some reason.22:56:47
9 Dec 2020
@gitter_rsegecin:matrix.orgRinaldi Segecin (Gitter) joined the room.01:43:06

Show newer messages


Back to Room ListRoom Version: 5