投稿時間:2022-11-27 00:07:41 RSSフィード2022-11-27 00:00 分まとめ(8件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
GCP gcpタグが付けられた新着投稿 - Qiita Google Cloudアップデート (11/17-11/23/2022) https://qiita.com/kenzkenz/items/3bc3db15bbef3da5d19d cloud 2022-11-26 23:23:46
海外TECH DEV Community Super Simple Select Implementation Using Angular CDK Selection Model https://dev.to/angular/super-simple-select-implementation-using-angular-cdk-selection-model-52gb Super Simple Select Implementation Using Angular CDK Selection ModelBuilding out Selection feature for tables list can be challenging at times because of a lot of corner case that needs to be handled Here s how we can build one without writing much logic using the Angular CDK s SelectionModel utility Angular CDK SelectionModelAngular CDK comes with a lot of utilities and components that we can use to build our application One such very useful utility is the SelectionModel utility that is part of the Collections utilities in Angular Material CDK SelectionModel is a utility for powering the selection of one or more options from a list This model is used in components such as the selection list table selections and chip lists Understanding the API ️The Selection Model class comes with a lot of handy methods that make it super easy to maintain the state of selections Here s how we can use it const selectionModel new SelectionMode lt string gt The class constructor takes in these arguments multiple whether we can select multiple items at a time multi select initiallySelectedValues initial selectionemitChanges Whether to emit changes selectionModel changed property compareWith A method that can hold the logic for identifying if an item is selected Usage with all the arguments provided export interface Movie id number name string year string const selectionModel new SelectionModel lt Movie gt true lt multi select lt Initial selections true lt emit an event on selection change otherValue value gt otherValue id value id lt compare method which checks the id of the movie We can provide a custom compareWith method to get if a checkbox is selected selectionModel isSelected method Here s how it s used internally isSelected value T boolean if this compareWith for const otherValue of this selection this selection is a Set if this compareWith otherValue value return true return false return this selection has value Building a Table with Selection ️Now let s use the selection model to build a table with ability to select a row and also have a global checkbox to Select All Deselect All lt section gt lt table gt lt thead gt lt tr gt lt th gt lt input type checkbox checked selectionModel selected length gt indeterminate selectionModel selected length gt amp amp selectionModel selected length lt tableData length change onCheckAllChange event gt lt th gt lt th gt Name lt th gt lt th gt Year lt th gt lt th gt Rating lt th gt lt tr gt lt thead gt lt tbody gt lt tr ngFor let row of tableData gt lt td gt lt input type checkbox checked selectionModel isSelected row id change onCheckRowChange row gt lt td gt lt td gt row name lt td gt lt td gt row year date short lt td gt lt td gt row rating number lt td gt lt tr gt lt tbody gt lt table gt lt footer gt lt button type button click toggleSelectAll gt isAllSelected Deselect All Select All lt button gt lt footer gt lt section gt Component selector sreyaj exp cdk selection template lt see code above gt standalone true changeDetection ChangeDetectionStrategy OnPush imports NgForOf DatePipe DecimalPipe export class CdkSelectionComponent readonly tableData MockData readonly selectionModel SelectionModel lt number gt constructor this tableData MOCK TABLE DATA this selectionModel new SelectionModel lt number gt true get isAllSelected boolean return this selectionModel selected length this tableData length public onCheckAllChange event Event void const isChecked event target as HTMLInputElement checked if isChecked this selectAll else this deselectAll public onCheckRowChange row MockData void this selectionModel toggle row id public toggleSelectAll void if this isAllSelected this deselectAll else this selectAll private selectAll void this selectionModel select this tableData map row gt row id private deselectAll void this selectionModel clear Here I ve used the id property to maintain the selection state but we can use the full data also for the selection All selection and indeterminate state The way we check for all selection intermediate state is lt input type checkbox checked this selectionModel selected length gt indeterminate this selectionModel selected length gt amp amp this selectionModel selected length lt this tableData length change this onCheckAllChange event gt We mark checked by checking if at least one item is selected by looking at the length of the selected items checked this selectionModel selected length gt Next we set the indeterminate state by checking if at least one is selected but not all indeterminate this selectionModel selected length gt amp amp this selectionModel selected length lt this tableData length Selection change event ️We can configure if the selection model should emit an event on change or not This is specified using the emitChange argument in the constructor Here s what the event looks like export interface SelectionChange lt T gt source SelectionModel lt T gt added T removed T selectionMode changed subscribe change SelectionChange gt console log change We ll be able to get the list of items added and removed and the model itself in case we want to do more when the selection changes The good thing about the selection model is that it s not coupled to any component it s completely headless It can be used with lists and other similar components A small but really good utility that allows us to concentrate on the actual business logic instead of things like this Code and Demo TitleLinkSource CodeDemoAngular CDK SelectionModel Docs selectionmodelAngular CDK SelectionModel Code Connect with meTwitterGithubLinkedinPortfolioHave any thoughts or questions shoot em below in the comments Stay Safe ️ 2022-11-26 14:29:09
海外TECH Engadget iRobot's premium Roomba s9+ robot vacuum is $220 off right now https://www.engadget.com/irobots-premium-roomba-s-9-plus-robot-vacuum-is-220-off-right-now-140048013.html?src=rss iRobot x s premium Roomba s robot vacuum is off right nowThe Roomba s has been around for a couple of years and it s probably overkill for most people At it s certainly not cheap but it did earn a spot in our list of best robot vacuums Right now you can pick up the high end machine for less than usual by shopping through Wellbots and using the code ENG at checkout A final price of is the best we ve seen on this smart home gadget and while it s still an expensive device it s a much easier to recommend when its on sale like this Buy Roomba s at Wellbots You probably don t need all of the bells and whistles that the s provides but they are some of the things that make it one of the best robot vacuums available today It s the most attractive in iRobot s lineup with a sleek design that can get into room corners more easily than other models and a tall slim clean base It has x the suction power of a standard Roomba making it a great option for households with pets and kids It s careful driver feature uses a D sensor to detect objects so it can move around them to clean and like all Roombas it will automatically return to its charging base when it s low on power In our testing we found the s to be an incredibly capable cleaner and while on the loud side it s no more noisy than other robo vacs in this price range When emptying its bin into its clean base it was actually not as loud as the Roomba j so it s less likely to scare your pets while doing so The clean base does use proprietary bags from iRobot though so just keep in mind that you ll have to consistently buy those in order to make full use of the s Thankfully each bag can hold up to days worth of debris The Roomba s also connects to iRobot s mobile app from which you can control the machine set cleaning schedules and more It s one of the easier robo vac companion apps we ved used so even if you re gifting the s to a loved on who is a novice they should have no trouble getting the thing set up and using it regularly If you re willing to splurge this holiday season the s is one of the best robo vacs you can get for your money Get the latest Black Friday and Cyber Monday offers by following EngadgetDeals on Twitter and subscribing to the Engadget Deals newsletter 2022-11-26 14:00:48
海外TECH WIRED 84 Best Amazon Deals For Black Friday (2022): iPads, Apple Watches, and More https://www.wired.com/story/best-amazon-black-friday-deals-2022-2/ amazon 2022-11-26 14:14:00
ニュース BBC News - Home London firefighters face sack over bullying and racist behaviour https://www.bbc.co.uk/news/uk-england-london-63767823?at_medium=RSS&at_campaign=KARANGA london 2022-11-26 14:33:57
ニュース BBC News - Home Deadly landslide tears through Italian island of Ischia https://www.bbc.co.uk/news/world-europe-63767660?at_medium=RSS&at_campaign=KARANGA ischiaa 2022-11-26 14:49:47
ニュース BBC News - Home Train strikes: Drivers walk out in pay row https://www.bbc.co.uk/news/business-63755411?at_medium=RSS&at_campaign=KARANGA companies 2022-11-26 14:02:17
ニュース BBC News - Home World Cup 2022: England's Harry Kane needs a rest – Alan Shearer https://www.bbc.co.uk/sport/football/63762807?at_medium=RSS&at_campaign=KARANGA World Cup England x s Harry Kane needs a rest Alan ShearerFormer England captain Alan Shearer says the Three Lions need to freshen things up against Wales in Tuesday s final game of the group stage at the World Cup 2022-11-26 14:31:08

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)