The Controller saves the Command ing of all commands. The Command class is stateless and is created only when needed. Command is responsible for processing complex data logic. Its use is summarized in two ways. 1. send Notification to trigger Command2.addSubCommand ()... SyntaxHi
The Controller saves the Command ing of all commands. The Command class is stateless and is created only when needed.
Command is responsible for processing complex data logic. Its use is summarized in two ways.
1. trigger Command by sending Notification
2. addSubCommand () to start
Let's get started right away.
Create a controller folder under the demo folder, and create a js file named StartupCommand. js under the controller folder. Enter the following content
[Javascript]
Var StartupCommand = Objs ("sweeps. controller. StartupCommand ",
MacroCommand,
{
/**
* @ Override
* Add Subcommands to start the PuerMVC component.
* Generally, the Model (Proxy) and View (Mediators) are prepared first );
*/
Initializemedia command: function (note)
{
Alert ('Received from facade ');
// This. addSubCommand (PrepModelCommand );
// This. addSubCommand (PrepViewCommand );
}
});
Create a folder abc under the demo folder to store Noticefiction, create the NotificationNames. js file under the abc folder, and enter the following content
[Javascript]
Var icationicationnames = Objs ("demo. abc. NotificationNames ",{});
Icationicationnames. STARTUP = "startup ";
Import the StartupCommand. js and icationicationnames. js files in the html file.
[Html] view plaincopyprint?