Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
JuanCarlosJr97
@juancarlosjr97
Did you change any environment variable???
@ronfogel
Ron Fogel
@ronfogel
Nothing special
Actually, the only environment variable exists when you do ng new is production: false/true (I dont have that in my environment file)
Adnan Ebrahimi
@adnanebrahimi
Does anyone knows how to use Service inside Libs?
I want to generate a service inside Libs and use it everywhere
Eric
@sliceofbytes
export your service and add it to the public_apis
Adnan Ebrahimi
@adnanebrahimi
what is public_apis ?
Note that i am using Nx.dev and i have a mono repo with 3 angular apps inside it. i want to create a http libs and use it in these 3 apps
Eric
@sliceofbytes
It's where you define your exports for a library
public_api.ts
JonathanFloresPacheco
@JonathanFloresPacheco
Hello
I need help with a MatTableDataSource. How can I get access to the data to modify a value that will bring me from a post?
aditya
@adibro500
hi i m having issue with implementing proxy using angular-cli
my proxy.conf.json looks like this
"/api": {
"target": "http://10.89.99.234:8111",
"secure": false,
"changeOrigin": true
}
}
my command to start the dev server is:
ng serve --proxy-config proxy.conf.json --host 0.0.0.0 --port 4500
can plz anyone help me with this ?
i am looking for a quick fix
the proxy details are altered for security reasons
can anyone plz give a look at my issue ?
aditya
@adibro500
thanks in advance ;-)
Sathish Jayapal
@sathishjayapal
Hello- am trying to package the angular CLI 8.x version and install. But it is looking to answer the google analytics prompt. Am trying to automate this and deploy this in a few hundred machines, is there a way that this question does not have to be answered during install.
Sathish Jayapal
@sathishjayapal
Hello- am trying to package the angular CLI 8.x version and install. But it is looking to answer the google analytics prompt. Am trying to automate this and deploy this in a few hundred machines, is there a way that this question does not have to be answered during install. More information about this "https://github.com/angular/angular/blob/master/aio/content/marketing/analytics.md", when doing a package install pushing to other machines it gets tricky and is expecting a user prompt. Any advise on how to get around this., thanks.
ZBAGI
@ZBAGI
Is there a way to create inline modal in angular2 material design ?
mikejf-pr
@mikejf-pr
Hi; with angular cli builders, is there a way to have muiltiple builders for 'serve' which happen sequentially? I'd like to keep using the build-angular builder task (and looking at in future switching to bazel) but have a postbuild operation which happens after builds, including after ng serve rebuilds
ZBAGI
@ZBAGI
@ZBAGI
Why @angular/cdk/keycodes doasnt contain DOUBLE_QUOTA or something like that " ??
it only contains code SINGLE_QUOTE
I have checked and numer assigned to it:
export declare const SINGLE_QUOTE = 222; and looks like 222 is a Quote code not SINGLE_QUOTE as in angular
David Stellini
@davidstellini
Hey guys, a bit of an annoying question with material design. I have managed to get dynamic themes to work - this is quite easy. But now it seems that the client wants to be able to pick the primary colour and accent colour using a palette
Now, aside from recompiling all the scss per client - is there any feasible option to change the primary and accent colours at runtime?
Again - these are not predetermined, otherwise it would be super easy.
Eric
@sliceofbytes
Set all the material2 colors to a css-variable
then just set that css-variable in your runtime
David Stellini
@davidstellini
Not sure if I'm following. how do I "set a css variable" in my runtime using JS?
The only thing I can do it seems, is switch up classes. Imagine 200 different clients / colour combinations - what then?
they're loaded up from an API
Eric
@sliceofbytes
document.documentElement.style.setProperty('--some-variable', 'orange')
then in material scss just set the primary color to --some-variable etc...
David Stellini
@davidstellini
interesting - will try that
Eric
@sliceofbytes
Tanner B. Hess Webber
@Tbhesswebber

Is there a way to run ng g c person with a flag to only return impacted paths rather than <ACTION> path (size)?

I realize that this is a weird question, but I'm about to start teaching a course on Angular and want to do a brief dive into TS first. We'll be building a simple, immature VSCode extension that wraps the Angular CLI and I want to take created files from the generate command and open them. We could use RegEx, but that seems to be a potentially unstable solution...

Alibra
@thedubb
Hi All, I just wanted to ask if there was anyone here who has had success with implementing a component created using angular-cli using angular elements into another angular project? I can get this working locally but I can’t seem to get this working on production and I just wanted to see if there was anyone else who shared the same experience.
Eric
@sliceofbytes
@thedubb what error are you getting, would probably be more useful to fix your issue
Alibra
@thedubb

@sliceofbytes I’ve gone through a series of different errors but the I first ran into a zone.js error:

Uncaught Error: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.

Which I researched and found out that it’s better for angular components to use a push strategy for change detection so I removed zone.js from my component which got rid of that error.

Next error I received was:

Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name “app-my-button" has already been used with this registry

Which I was able to resolve with a check if (!customElements.get('element')) customElements.define('element', buttonElement);

Now that I’ve added that check, in production, my page does not load (no console errors either). Since I used angular CLI to create my elements project and combined all of my .js files into one, I’m thinking there must be some sort of conflict between my elements .js file and the .js file of the angular application that I’m using my element.js file in. I’ve been up for days trying to resolve this. I initially followed: https://blog.bitsrc.io/using-angular-elements-why-and-how-part-1-35f7fd4f0457 to create my web component (it’s more or less the same as other articles I’ve read). Locally everything runs as expected.

I should also mention that I’m using angular 8 for both my application and my web component
Eric
@sliceofbytes
@thedubb have you looked over the angular.io code that uses custom elements
I would follow their example
Alibra
@thedubb
thanks @sliceofbytes i’ve taken a look at angular.io but haven’t seen the link you posted, I’ll take a look at that.
matias-quezada
@matias-quezada

hey there, I'm having troubles with AOT and after hours of Googling I can't find a solution. Let me be concise, I load two different components depending on a property of environments

const routes = [{
  //...
  component: environment.foo ? FooComponent : BarComponent
}];

What's special in my project is that environment.ts file is lazy loaded, so same Docker container runs on different environments

// environment.ts
export const environment = (window as any).__env;

The issue is that when I run ng build with AoT enabled this is generated:

const routes = [{
  //...
  component: BarComponent
}];

It's like AoT is evaluating environment.foo on build time, can I prevent that?