Assuming Snackbar extends UIBase, you can define a default model by adding 
something like this in mdl’s defaults.css



Snackbar

{

              IBeadModel: 
ClassReference("org.apache.flex.mdl.beads.models.SnackModel");

}



You can add a default controller the same way. If you look in HTML’s 
defaults.css you’ll see some usage examples.



Typically, the controller will listen to user events, change the model, which 
in turn will throw an application event that will update the view.



I’ve found it useful to just look at code for components in HTML, and learn 
from similar cases that have already been implemented.



From: piotrz<mailto:piotrzarzyck...@gmail.com>
Sent: Tuesday, December 27, 2016 10:15 PM
To: dev@flex.apache.org<mailto:dev@flex.apache.org>
Subject: Re: [FlexJS] Setting up FlexJS and MDL



I think I could also creat for Snackbar model, cause in order to show
snackbar I need to build object:

var snackbarData = {
                    message: _message,
                    timeout: _timeout,
                    actionHandler: onActionHandler,
                    actionText: _actionText
                };
Currently object data message, timeout is part of component, but probably it
should be part of model.

Question is - can some model be default for component?

Piotr



-----
Apache Flex PMC
piotrzarzyck...@gmail.com
--
View this message in context: 
http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Setting-up-FlexJS-and-MDL-tp57491p57593.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply via email to