Blazor JavaScript Interop (Easy How To)

Поделиться
HTML-код
  • Опубликовано: 5 окт 2024
  • Adding JavaScript to a Blazor project.
    Code Repo: github.com/Cod...
    Movie Site: cf-blazormovie...
    -----------------------------------------------------------------
    👨‍🏫 Self-Paced .NET Bootcamp Course (Includes FREE courses)
    learn.coderfou...
    🙌 Support the channel and become a channel member
    / @coderfoundry
    📖 Buy the Book: Breaking the Code
    geni.us/breaki...
    👕 Grab some CF merch
    teespring.com/...
    🗣 Join us on Discord
    ​ / discord
    👓 Buy the blue light blocking glasses we use at CF. Pixel Eyewear Glasses ($5 off with coupon code CODERFOUNDRY)
    www.pixeleyewe...
    💻 How to get your first coding job
    coderfoundry.co...
    🎥 The equipment we use at Coder Foundry
    kit.co/CoderFo...
    DISCLAIMER: This video and description may contain affiliate links, which means that if you click on one of the product links, we’ll receive a small commission. This helps support the channel and allows us to continue to make videos like this. Thank you for your support!

Комментарии • 45

  • @100kghighkick9
    @100kghighkick9 6 месяцев назад +3

    Wow, I started developing 1.5 years ago and guys like you boost my progress so much, thx for your effort.🔥

  • @iheanyichukwuaguwa6231
    @iheanyichukwuaguwa6231 8 месяцев назад +2

    Thanks for this. Blazor Js interop has always been a bit confusing until this video dropped. Thanks again

  • @philmingo
    @philmingo 5 месяцев назад +1

    Now this is how you explain stuff !!
    Thanks much!!

  • @stevenvillarreal8970
    @stevenvillarreal8970 5 месяцев назад

    This is an awesome tutorial! Easy explanation with a great example 🙌!

  • @oncalldev
    @oncalldev Месяц назад

    Very well done.

  • @gilleyt
    @gilleyt 5 дней назад

    Great Video thanks

  • @yogxoth1959
    @yogxoth1959 2 месяца назад

    I feel like I've done exactly the same as you, but I'm getting an error in the browser that "'myFunction' was undefined".

  • @cissemy
    @cissemy 8 месяцев назад +3

    Blazor is powerful .

  • @pixel7038
    @pixel7038 5 месяцев назад

    Does Microsoft ever plan on creating a synchronous version using js interop?

  • @mateofernandez273
    @mateofernandez273 3 месяца назад

    very good, god gamer. This is the new meta

  • @kell7689
    @kell7689 2 месяца назад +1

    I'm having so much trouble exporting a js class. I can import the isolated JS no problem, but it can't find any of the class members...

    • @zaspalia
      @zaspalia Месяц назад

      Having the exact same problem right now. The only way I’ve been able to get around it is by creating a separate function that returns an instance of that class and calling it from my razor components. Microsoft also has an example assigning a class with static methods to the window but that doesn’t seem to work for instantiations.

    • @kell7689
      @kell7689 Месяц назад +1

      @@zaspalia that is *exactly* how I’ve been working around it. Weird.

  • @shjaaz4139
    @shjaaz4139 8 месяцев назад

    Hi dear, Can you do portfolio reviews live stream, ve been waiting for so long .. :((

  • @jaxongirrahimov7908
    @jaxongirrahimov7908 8 месяцев назад

    Do you think building CRM is also as effective as Bug Tracker?

  • @olamidejames7968
    @olamidejames7968 7 месяцев назад

    Hi, thanks for this. However, I find it difficult to work with existing javascript libraries. Do you have a video on how to work with external javascript libraries?

    • @CoderFoundry
      @CoderFoundry  7 месяцев назад

      Which one?

    • @samjohnson5203
      @samjohnson5203 6 месяцев назад

      Im looking to better understand the same. I'm doing a comparison of charting libraries such as Highcharts and Apache Echarts. There's likely something out there for Blazor already, given the popularity of those libraries.
      A video on going from JS to an Interop version for Blazor would be neat to see.

  • @firstlast493
    @firstlast493 2 месяца назад

    How to make this app without Javascript?

  • @unskeptable
    @unskeptable 5 месяцев назад

    Can a .net 8 web mvc project with jquery be updated to also use blazor ?

    • @CoderFoundry
      @CoderFoundry  5 месяцев назад

      It's a rewrite. The architecture is different.

  • @Cos3D
    @Cos3D 5 месяцев назад

    is it possible to interop blazor with three js to upload/import a 3d obj file from blender that has animations?

    • @CoderFoundry
      @CoderFoundry  5 месяцев назад

      Maybe. I would have to try.

  • @OrekiBurd
    @OrekiBurd 6 месяцев назад

    Does it not work with client components? The ones that uses [InteractiveAuto] specifically. It finds the js function from server components but gives an error saying something like "function not defined" when calling from client components that use [InteractiveAuto]

    • @CoderFoundry
      @CoderFoundry  6 месяцев назад

      Interactive auto means the component can execute on the server and dom updates via siqnalr. It can also execute via wasm which executes on the client which uses interop.

  • @wisnu7734
    @wisnu7734 3 месяца назад

    Is it possible to implement this code in blazor ssr ??

  • @Glockodile
    @Glockodile 5 месяцев назад

    Hi, does this also work with blazor server?

    • @CoderFoundry
      @CoderFoundry  5 месяцев назад

      It most cases. You cannot modify the dom with js because it clashes with blazor.

  • @codeDotnet
    @codeDotnet 8 месяцев назад

    Wow ,amaizing ,thank so much

    • @CoderFoundry
      @CoderFoundry  8 месяцев назад +1

      I'm glad it helped.

    • @codeDotnet
      @codeDotnet 8 месяцев назад

      @@CoderFoundry Can you give me a website link so I can design icons like yours?

  • @mhsn27mhsn10
    @mhsn27mhsn10 5 месяцев назад

    thank you

  • @figloalds
    @figloalds Месяц назад

    16:50 ah yes
    Coding in impossible edge caes because "You never know"
    This is just future proofing. Yes it's objectively impossible right now that that would be null. But what about a few months from now when "John Doe" makes some edits to this code?
    You literally never know

  • @10Totti
    @10Totti 8 месяцев назад

    Best Tutorial thanks!