Angular Study notes (cdk-accessibility)

Source: Internet
Author: User

@angular/CKD is Ng's infrastructure for UI builds.

is developed and maintained by the material team, the reason why there is CDK seems to be because in the development of material at random abstraction a level out for everyone to use.

This series is I follow the official website tutorial and check the angular/material source of learning notes.

1. Keymanger

The application scenario is select, menu, which has the list options component, which is responsible for the logic of the option active when handling the keyboard up and down buttons

NG provides 3 classes of Listkeymanager, Focuskeymanager, Activedescendantkeymanager, focus, and active that are actually inherited by the Listkeymanager in general, with the same functionality.

It is very simple to use:

Chip-list.ts

@ContentChildren (matchip) chips:querylist<matchip>;
 This New Focuskeymanager<matchip> (this. chips). Withwrap ();

When instantiating the options to throw in, withwrap to support the loop, note that the option component to implement the Listkeymanageroption interface, so that Keymanager can set the active Ya

From the Keymanger of several methods to see its function of the source code

Setactiveitem (Index:number) OnKeydown (event:keyboardevent) setfirstitemactive () setlastitemactive () Setnextitemactive () setpreviousitemactive ()

Angular Study notes (cdk-accessibility)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.