Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Jorrit
@jorrit-wehelp
@S-Stephen if you don't "return" anything, it would be type "void".
@S-Stephen But on the other part of the questions: what does validList$ do? Does it complete after a single value?
Shekhar Ramola
@shekharramola
@jorrit-wehelp can we do it using css ?
image.png
if I somehow able to add display:none there, then it will be gone
StephenS
@S-Stephen
@jorrit-wehelp validList$ is a pipe from a http.get, which is in a switchMap, the alert displays via the tap, and when I put a further tap after the map that also triggers. The type of validList$ is Observable<string[]>.
Jorrit
@jorrit-wehelp
@shekharramola sure can hide it... but I'd suggest checking the documentation of the chatbot script. They usually have a method you can call to properly remove the chat UI element
only hiding it would make it keep running in the background :/
The usual problem with anguar/pwa and chat bots is that you want to make sure to only load the script once. Then enable/disable the UI widget on certain pages by calling their API
fully unloading is usually not the problem, more often loading it multiple times and leaking memory that way is the problem :/
StephenS
@S-Stephen
@jorrit-wehelp you are correct the observable doesn't complete!
Jorrit
@jorrit-wehelp
@S-Stephen .take(1) :)
also .mapTo({project: true}) would avoid the possible confusion with fat arrow functions returning object literals
StephenS
@S-Stephen
@jorrit-wehelp arghh - thank you!
nice tip - thanks
Saudamini
@Saudamini_gitlab
hi Guys.How to user angular drag and drop.
can anyone give some idea
StephenS
@S-Stephen
@Saudamini_gitlab I use the material libraries for this: https://material.angular.io/cdk/drag-drop/overview
Saudamini
@Saudamini_gitlab
thanks @S-Stephen
Shekhar Ramola
@shekharramola

@jorrit-wehelp thanks for guiding.. I found some method..but for that I need to access HubSpotConversations

when I log console.log(window), I see, it is there but using dot operator, it is coming as null. how to access it?

image.png
Jorrit
@jorrit-wehelp
@shekharramola not familiar with hubspot, should again check their documentation to see if there is some way to know when it has finished loading (and the global is available)
Often there is some callback or queue style mechanism available to initialize/do stuff when their script is ready
Shekhar Ramola
@shekharramola
@jorrit-wehelp , thanks.. now I am able to load and remove the widget.. I have created a service fo load and removing widget. now in every component ngoninit, I have to load the widget and on ngondestroy, I have to remove the widget.. However.. I have a lot of pages. I only want to show it in 4 or 5 pages.. Is there anything I can do.. something like watching for routes and displaying only at some routes ? widget is open by default
Jorrit
@jorrit-wehelp
@shekharramola if it opens by default, i'd immediately remove it in the service (and probably some CSS to hide it, if it's showing up briefly in that time).
@shekharramola then i'd probably write a component to 'show' it I guess, to make it work more nicely in angular
which just calls the show/remove in the central service
tijanimlouki
@tijanimlouki_twitter
hello , wan i make form in component i find this error "ERROR TypeError: Cannot read property 'getFormGroup' of null".
please help me
Derek
@derekkite
@tijanimlouki_twitter is the form initialized when you call that function?
itbrandonsilva
@itbrandonsilva
Does anyone have an idea why this would be possible to see on SimpleChanges?
currentValue: undefined; firstChange: false; previousValue: undefined;
This is also experienced with defined values as well, where we can sometimes assert that the previous and current values are referentially equal (so clearly nothing changed).
Shekhar Ramola
@shekharramola
when you use any third party library and use it in service
declare const thirdPartyVariable but when doing npm run test, it breaks, how to fix the problem thirdPartyVariable is not defined
I tried to mock it like this
declare global { interface Window { HubSpotConversations: object; } }

window.HubSpotConversations = {};


describe('HubSpotConversationsService', () => {
  let service: HubSpotConversationsService;

  beforeEach(() => {
    TestBed.configureTestingModule({});
    service = TestBed.inject(HubSpotConversationsService);
  });

  it('should be created', () => {
    expect(service).toBeTruthy();
  });
});
but I still get the same issue
Danilo Silva
@danilosilvadev

Does someone know why is complaining about the same type?

Type 'Status' is missing the following properties from type '{ username: string; wordcount: number; fontSize: number; fontFamily: number; }': username, wordcount, fontSize, fontFamily

haneatic
@haneatic
Because its missing properties? Whats your code?
Danilo Silva
@danilosilvadev

@haneatic this is the model:

export interface User {
  username: string;
  wordcount: number;
  fontSize: number;
  fontFamily: number;
}

//other file
import { User } from './user.model';

export interface Status {
  status: User;
}

and this is the obj is trying to type:

status: {
    username: '',
    wordcount: 0,
    fontSize: 0,
    fontFamily: 0,
  },
haneatic
@haneatic
Declare the user object before and specify its type. Then assign it to the status
Danilo Silva
@danilosilvadev
user is not an object, is an interface
tijanimlouki
@tijanimlouki_twitter
hi , i want to add function upload with api firebase but i have thi error "ERROR Error: Uncaught (in promise): [object Undefined]" please help me
Jason Fortik
@jasonfortik_gitlab
hello everyone im new to angular
i have little experience with javascript but i do know a fair amount of c++
yall think imma get good at it or should i shift focus to tsc?
jephcodes
@jephcodes
tsc = Typescript?
I'm new to Angular too, but I have used AngularJS quite a bit in the past. I loved it. Made it super easy to write web apps :) If you can make your way with C++, you can probably figure out Angular/JavaScript/TypeScript pretty easily with some googling.
Dario Vogogna
@akyrey
@danilosilvadev is that the full object you are trying gto type?
@itbrandonsilva are you using ChangeDetection OnPush or Default?
Dario Vogogna
@akyrey
@jasonfortik_gitlab i think it wont be a problem! I'd advice to use stricttypings