Create Your First Angular Library - Nir Kaufman

  Рет қаралды 38,018

AngularNYC

AngularNYC

Күн бұрын

Пікірлер: 75
@ciprianionutiacob7883
@ciprianionutiacob7883 4 жыл бұрын
I think it's worth mentioning that you can do ng build magic-lib --watch=true and that will watch for changes in lib and automatically update the application.
@tawandakanyangarara9248
@tawandakanyangarara9248 4 жыл бұрын
Dude you are a champion ✊🏿
@boris_js
@boris_js 4 жыл бұрын
I did the same for a remote app in my machine through npm link. This command works whenever i make changes in my lib, it reloads my remote app but does not reflect the latest lib changes. I have to ng serve everytime on the remote app to reflect the changes. Any suggestion on this
@user779hjg45
@user779hjg45 4 жыл бұрын
Thank you!
@quilagameplay3161
@quilagameplay3161 3 жыл бұрын
very usefull indeed
@elazarzadiki3059
@elazarzadiki3059 2 жыл бұрын
use npm link on both your dist/your-library folder and your root folder, then ng build your-library --watch and ng serve, changes will be updated automatically.
@programmercouple
@programmercouple 3 жыл бұрын
Till date, I use this video every time I want to create a new Angular Library
@EliRabinovitz
@EliRabinovitz 4 жыл бұрын
First time I've seen someone program like me. Define names once, copy paste after. Thanks for a great tutorial
@doron99
@doron99 2 жыл бұрын
אלוף! תענוג כמה ידע, תודה רבה!
@MikeBritton
@MikeBritton 3 жыл бұрын
This is the best Angular Library Development video out there right now (03/10/2021). Nice work
@nirkaufman101
@nirkaufman101 3 жыл бұрын
Thanks!
@paolatellez293
@paolatellez293 5 жыл бұрын
Explanation is to the point, very clear and helpful. Thank you Nir Kaufman.
@abhimalvekr127
@abhimalvekr127 3 жыл бұрын
After watching this super explanation, I am a fan of Nir Kaufman!
@rembautimes8808
@rembautimes8808 3 жыл бұрын
Great talk Nir. Was watching your video while waiting for some noodle 🍜 to be delivered.
@SahanSerasinghe
@SahanSerasinghe 4 жыл бұрын
Thanks Nir. Awesome presentation!!! This is exactly what I was looking for
@jasonwilliams_escapeimagery
@jasonwilliams_escapeimagery 4 жыл бұрын
An excellent talk. Very informative.
@mohammedaminaimeur6892
@mohammedaminaimeur6892 3 жыл бұрын
Amazing video, so clear and straight forward, I would've loved to see the rest of it though :(
@franco1g
@franco1g 2 жыл бұрын
Ditto. I'd like to see the install and consumption
@adeptairsoft6460
@adeptairsoft6460 3 жыл бұрын
Great tutorial! Thank you 👍
@ip2pi
@ip2pi 4 жыл бұрын
Great tutorial, nicely explained (+ learned some new capabilities in angular :) ) Toda !!
@antoniofcable
@antoniofcable 5 жыл бұрын
Very nice explanation. Congratulations. Very useful for me. This is what I was looking for.
@nirkaufman101
@nirkaufman101 5 жыл бұрын
Thanks!
@aram5642
@aram5642 4 жыл бұрын
Would be cool to watch a video on setting entire CI github pipeline too :) BTW. if we cared about the `nk-` prefix for the library, by the same token we should also use `nk-mark` class instead, to try to avoid naming clashes.
@sakethpavan4901
@sakethpavan4901 2 жыл бұрын
Great explanation!
@dachd
@dachd 5 жыл бұрын
I like this man!
@nirkaufman101
@nirkaufman101 5 жыл бұрын
Thank you for your feedback!
@mdrizwanansari
@mdrizwanansari 3 жыл бұрын
felt like 'Cisco Ramon' is teaching me
@pablomoreno4495
@pablomoreno4495 2 жыл бұрын
jajajaja!!! you have a point bro ! 🤣
@prem101434
@prem101434 3 жыл бұрын
We can use storybook to check the library right?.
@SelimAbidin
@SelimAbidin 4 жыл бұрын
For those who have some problems. Make sure that you use NPM or Yarn. Not both together. If you are going to use another package manager, first remove package lock file.
@pranavbhatia6637
@pranavbhatia6637 4 жыл бұрын
Really helpful video. Thanks!
@brabenetz
@brabenetz 4 жыл бұрын
First at all: Thanks for the video! It helped me a lot! But at 13:30 "Import library as regular module" I see two problems: - Running the testbed app will change the content in the dist-folder (Maybe a newer problem which only exists since angular 9 with Ivy ) - Auto-Restart during development is also not available So I prefer the less realistic version to integrate the library directly from the src folder. What you think?
@yasenbonev7879
@yasenbonev7879 4 жыл бұрын
I don't remember where exactly I saw it, maybe the documentation, but if you're importing the source code of a library you're in for a hell of a ride, there is a reason why libraries are packaged with ng-packagr and applications are not. These difference will kill your brain cells.
@brabenetz
@brabenetz 4 жыл бұрын
@@yasenbonev7879 At least one concrete point to your paragraph would be nice :) What is you source? what are the reason you speaking of? What you mean with "hell of a ride" or "will kill your brain cells". Your comment is really very blurry :)
@ashishnamdeo6879
@ashishnamdeo6879 5 жыл бұрын
Really nice explanation.....
@nirkaufman101
@nirkaufman101 4 жыл бұрын
Happy to hear it :)
@swatijoshi7614
@swatijoshi7614 4 жыл бұрын
Hi Team, Great tutorial, nicely explained concepts and reasons :) Thank you. Do we have a further part after this video this seems some more part is missing?
@sasagasparovic9351
@sasagasparovic9351 3 жыл бұрын
I want more tutorials from that guy :D
@lupinasp
@lupinasp 4 жыл бұрын
Thanks Nir, great presentation! I've got an error in ViewEncapsulation part. If someone needs here's how to fix it (Angular 8): Change: import { ViewEncapsulation } from '@angular/compiler/src/core'; To: import { Component, OnInit, ViewChild, ElementRef, ViewEncapsulation } from '@angular/core';
@akshaychavan6158
@akshaychavan6158 5 жыл бұрын
Nice explanation, How to use that package in another application?
@nirkaufman101
@nirkaufman101 5 жыл бұрын
Just npm install like any other package :)
@jose-chin
@jose-chin 5 жыл бұрын
@@nirkaufman101 but that is after publish to npmjs.org right?
@nirkaufman101
@nirkaufman101 5 жыл бұрын
@@jose-chin no need to publish to npm at all. All local. Use npm link
@rajathvenkatesh3253
@rajathvenkatesh3253 2 жыл бұрын
I am looking to share services and make them as singletons to be used between my shell and micro front ends in angular. I use angular architects module federation! I have multi repo MFEs so NX share libraries would not be a good option. Any advise?
@LongTran-nm3ne
@LongTran-nm3ne 7 ай бұрын
Hi sir. What to do next with .tgz file??
@robertbryan6485
@robertbryan6485 4 жыл бұрын
Someone mind explaining why the library's component needed to have the view encapsulation set to none? Setting a component's view encapsulation to none here seems like a code smell to me.
@manjaykumar-jb7yp
@manjaykumar-jb7yp Жыл бұрын
How to use Primeng as a dependency in custom angular library which is on angular version 15?
@arinmovsesian
@arinmovsesian 5 жыл бұрын
i cant create multiple library :( get this error (does not support the 'build' target)
@nirkaufman101
@nirkaufman101 4 жыл бұрын
Drop me an email. show me some code :) I'll try to help
@unnhao
@unnhao 4 жыл бұрын
24:32 I want to know about this extra configuration, but I can't find which meetup talk this. :(
@NicoDeathend
@NicoDeathend 4 жыл бұрын
I take a look quickly over this video kzbin.info/www/bejne/oanPdXmNmNyNmZY I think it may be, checkout minute 15:48
@angulardeveloper331
@angulardeveloper331 5 жыл бұрын
This is great! Very useful. Thanks man. Question: Let say in this new library I'd like to subscribe/emit new data to a behavior subject from app.service.ts, how do I do that? I tried it out by using: @Inject('AppService') private appService: any within the library, (because in AppService, it's injected to the root as @Injectable({providedIn: 'root'});, and I did put {provide: AppService, useValue: AppService } in AppModule), but I received an undefined error: Cannot read property 'subscribe' of undefined. Is there something I missed in dependency injection? I'll keep looking for an answer and come back here to post the solution if I found it. Thanks.
@MattDuarte11
@MattDuarte11 4 жыл бұрын
This is dope!
@zorglob007
@zorglob007 5 жыл бұрын
Nice video but i tried to make an angular library as a design system library and when i build the library, i don't have css or assets files include. Have you got any idea how to resolve this problem ?
@nirkaufman101
@nirkaufman101 5 жыл бұрын
Shoot me an email: nirkaufman@gmai.com
@BeautyHolicFamily8652
@BeautyHolicFamily8652 2 жыл бұрын
Nice channel
@subba18
@subba18 4 жыл бұрын
Can I build a prod app with many libraries like this for dynamic loading.. Will it work for say 50-70 libraries?
@kampkrieger
@kampkrieger 4 жыл бұрын
did it as you did, but it can't find the lib (magic-string). no clue what to do... What changed?
@kwentinn
@kwentinn 4 жыл бұрын
great ! thanks mate !
@nirkaufman101
@nirkaufman101 4 жыл бұрын
Thank you!
@amitapatiyal3228
@amitapatiyal3228 3 жыл бұрын
Is there any way to add external script in library. The way we have in application
@sachinpatil2253
@sachinpatil2253 3 жыл бұрын
Have you find any solution to add external script.
@arpitmalaiya2825
@arpitmalaiya2825 4 жыл бұрын
While using icons in the library , i was unable to get them in the app in which i was using library. Can anyone help me with it?
@msasoftware
@msasoftware 4 жыл бұрын
I was presented with an error message when compiling the library and resolved it at this point with the following: export class MagicStringComponent implements OnInit { @ViewChild ('content', {static: true}) content: ElementRef Angular "@ angular / cli": "~ 9.1.0",
@ManojKumar-rc5ze
@ManojKumar-rc5ze 4 жыл бұрын
Awesome ... Thanks for sharing this information
@GalloFranco
@GalloFranco 4 жыл бұрын
Someone find the complete talk?
@daniela.parionac
@daniela.parionac 3 жыл бұрын
How to update an Angular library project? if I use ng update @angular/core@12 @angular/cli@12 --force, this command is updating my Angular main project but not the library project. Which is sub part of the main project, I want update library project, help me please
@MrRorypam
@MrRorypam 4 жыл бұрын
This is Great tutorial. But i feel that i am facing the issue in angular9. that is after importing and adding MagicStringModule inside the imports like below imports: [ BrowserModule, MagicStringModule ], I am finding below exception Inspection info: Reports any symbols that are declared, imported or exported by an Angular module that are not modules, components, directives or pipes or can’t be used in the context of the property. Please help in i this regards.
@MrRorypam
@MrRorypam 4 жыл бұрын
@Nir please reply on this
@crazy_coder
@crazy_coder 4 жыл бұрын
Can i use third party library in my angular library?
@vinodkumar-yr4vd
@vinodkumar-yr4vd Жыл бұрын
Have you find any solution to this?
@ksaweryglab
@ksaweryglab 4 жыл бұрын
Thanks Nir for this very insightful video, BUT when I run yarn serve demo-app, then apply changes to the library, and then expect these changes to be visible in the app - I get the compiler errors telling me that the compiler cannot find library module - probably because when you ng build library - it will first remove the contents of the lib in dsit folder, triggerring the error, and then build it but at this stage the compiler that runs on the application is stuck on the error. So in my case I have to: - apply changes to library component - run ng build library - to populate the dist folder - stop and restart the ng serve demo-app --> something you don't have to do in your presentation So my question is - anyone else has similar problems to mine? I double checked and I import the library in app.module.ts in the same way Nir does.
@ksaweryglab
@ksaweryglab 4 жыл бұрын
Ok, I have a workaround - actually working even better. I run two commands: ng build libraryName --watch=true ng serve demoAppName --port=4300 First command rebuilds the library into dist folder every time you change the component. Second command runs the demo app in default watch mode and refreshes (without errors) when the library is rebuilt. This setup is fucking awesome if I may say so myself. Thanks to @CiprianIonutIacob below for hinting that you can run ng build lib --watch=true. Thanks man!
@B20C0
@B20C0 3 жыл бұрын
cool?
@prvinsharma
@prvinsharma 3 жыл бұрын
It's a bad practice using ViewEncapsulation.None. It causes css class pollution. Worse the libs/components doing it actually adds to the global css namespace as and when visited. This can lead to tricky bugs. On similar grounds, hate the way CSS needs to be overridden for material libs in global styles.scss file.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 23 МЛН
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 20 МЛН
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
Fullstack Angular w/ NestJS 🎤 Nir Kaufman
50:04
AngularNYC
Рет қаралды 4,8 М.
Standalone components in the world of Angular Ivy - Eliran Eliassy
38:01
Angular v19 Developer Event
22:54
Angular
Рет қаралды 64 М.
How to Create & Publish an Angular Library with Ionic 4 Components
24:54
How to make your own NPM package (Step-by-Step) 📦
16:46
Under Ctrl
Рет қаралды 35 М.
Complex features made easy with RxJS
36:13
Hasgeek TV
Рет қаралды 59 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 23 МЛН