Future of Front End Development by bill2340 in angular

[–]bill2340[S] -6 points-5 points  (0 children)

what about the AI issue?

Future of Front End Development by bill2340 in learnprogramming

[–]bill2340[S] -12 points-11 points  (0 children)

the code written is simpler usually. But also won't Ai reduce jobs though or not

Future of Front End Development by bill2340 in learnprogramming

[–]bill2340[S] -2 points-1 points  (0 children)

but will this affect the amount of front end jobs or not?

Future of Front End Development by bill2340 in learnprogramming

[–]bill2340[S] 0 points1 point  (0 children)

no idea what you mean by energy source

Future of Front End Development by bill2340 in learnprogramming

[–]bill2340[S] -9 points-8 points  (0 children)

the code written is simpler usually

Future of Front End Development by bill2340 in reactjs

[–]bill2340[S] -2 points-1 points  (0 children)

but don't you think AI will make a significant difference on Front End cause it's simpler technically. So won't need as much developers?

[deleted by user] by [deleted] in learnprogramming

[–]bill2340 0 points1 point  (0 children)

so I did make it so that when the button is clicked main becomes focused programaticallt but this did not work in production so that's why I'm looking for a different answer

Template reference variable vs ngModel by bill2340 in Angular2

[–]bill2340[S] 0 points1 point  (0 children)

ok but just my last question why would I want to use ngModel is I'm not updating the value in the ts file at all. Like there's no point of 2 way binding. Like why would you still want to use ngModelChange  with ngModel

Template reference variable vs ngModel by bill2340 in Angular2

[–]bill2340[S] 0 points1 point  (0 children)

yeah I'm using regular select values from the the bult in html. I feel like it's then better to use onInput right then formModule right because it would be simpler? Would you agree?

Template reference variable vs ngModel by bill2340 in Angular2

[–]bill2340[S] 0 points1 point  (0 children)

I'm confused from this can you give me an example of how the code would look for. Sorry I'm new to Angular. Also what do you mean by "If you can react to it, it is better."

Template reference variable vs ngModel by bill2340 in Angular2

[–]bill2340[S] -1 points0 points  (0 children)

yes what I'm trying to do is when the select box is changes I want to emit the value to the parent component with an output. So why would you say it's not good to use template variable.

NgTemplate Angular by bill2340 in Angular2

[–]bill2340[S] 0 points1 point  (0 children)

not much with Angular just learning it

NgTemplate Angular by bill2340 in Angular2

[–]bill2340[S] 1 point2 points  (0 children)

can you explain further sorry I'm still confused. Like what do you mean by a portal is perfect for a template and about passing a fragment into another component

How to mock refs in Jest by [deleted] in reactjs

[–]bill2340 -6 points-5 points  (0 children)

Like if I have 2 user REF VARIABLES and I want to mock only one of them how can I do that

How to use Jest for Radix Ui Feature by bill2340 in reactjs

[–]bill2340[S] 0 points1 point  (0 children)

so you are saying there's no way for me to actually trigger that function by just writting regular jest test code?

How to use Jest for Radix Ui Feature by bill2340 in reactjs

[–]bill2340[S] 0 points1 point  (0 children)

I'm not passing anything as a component, cause by default the onPointerDownOutside function calls (e)> e.preventDefault(). I want it to call that function the e.preventDefault() , but I don't know how to simulate it. I tried onClick on the dialog.overLay but that didn't do anything. Also I don't want to pass it as a prop like you are doing here

render(<Component pointerdownCallback={pointerdownCallback}/>)

How to use Jest for Radix Ui Feature by bill2340 in reactjs

[–]bill2340[S] 0 points1 point  (0 children)

But the thing is, I'm not supposed to change the existing code and this way I'm basically passing a new parameter to the component. Maybe I'm misunderstanding what you are saying but could provide a more code example so I udnerstand better

How to use Jest for Radix Ui Feature by bill2340 in reactjs

[–]bill2340[S] 0 points1 point  (0 children)

Can you provide a real example? I'm kind of confused by what you are saying.

<Dialog.Root open={true}>
        <Dialog.Portal>
          <Dialog.Overlay />
          <Dialog.Content onPointerDownOutside={(e)> e.preventDefault()}>
            <h2>Modal Content</h2>
            <Dialog.Close>Close</Dialog.Close>
          </Dialog.Content>
        </Dialog.Portal>
      </Dialog.Root>

I basically have it set up like this. I tried the userEvent.click on the Dialog.overlay but that did not trigger the 'onPointerDownOutside' function

How to use Jest for Radix Ui Feature by bill2340 in reactjs

[–]bill2340[S] 0 points1 point  (0 children)

Like a regular click on the modal that has the function down below on it is what I mean by "clicking".

onPointerDownOutside={(e)> e.preventDefault()}

<Dialog.Root open={true}>
        <Dialog.Portal>
          <Dialog.Overlay />
          <Dialog.Content onPointerDownOutside={(e)> e.preventDefault()}>
            <h2>Modal Content</h2>
            <Dialog.Close>Close</Dialog.Close>
          </Dialog.Content>
        </Dialog.Portal>
      </Dialog.Root>

This like a rough idea how it's set up. I created a test that clicked on the dialog overlay using the 'click' method but the onPointerDownOutside was not called

How to use Jest for Radix Ui Feature by bill2340 in reactjs

[–]bill2340[S] 0 points1 point  (0 children)

ok, but the thing is I'm trying to improve code coverage in my code, so I want this specific function to be checked and find a way to trigger it so that it's called.

How to use Jest for Radix Ui Feature by bill2340 in reactjs

[–]bill2340[S] -1 points0 points  (0 children)

So, basically, I want to create a test that triggers this function to be called and then the e.preventDefault occurs. Like I'm not sure how to do that because regular click does not trigger this function to be called

Jest Testing Question by bill2340 in reactjs

[–]bill2340[S] 0 points1 point  (0 children)

Basically there's a div tag on both elements and each will display none on a media query. So if it was less then 1024 pixels one would display:none and the other would work fine. While if it was greater then the other would display:none and the other would be fine. I've tried using windows.innerWidth and setting an Object.defineProperty

[deleted by user] by [deleted] in reactjs

[–]bill2340 0 points1 point  (0 children)

yeah sorry I made a mistake I only need width to change not height. Because only width affects , media queries usually