var feedback = {
title:"My box title",
msg:"This component is cool!!!", //you can pass simple text or html
close: true
};
$uiMrFeedback.open(feedback);
var functionClose = function(param){
console.log("Instance dismissed with the param: " + param);
};
var functionConnected = function(param1,param2){
console.log(param1 + "! You have pressed the button " + param2);
};
var feedback = {
title:"My box title",
msg:"This component is cool!!!",
theme:"ios",
modal:true, /*with modal:true the animation option is disabled*/
close: true,
closeText:"Chiudi",
fnClose:{
func:functionClose,
params:["Ok!"]
},
btnAction:[
{
text:"Button Yeah",
func: functionConnected,
params:["Excellent","Yeah"]
},
{
text:"Button Noooo",
func: functionConnected,
params:["Damn","Noooo"]
}
];
};
$uiMrFeedback.open(feedback);
$ bower install mrFeedback
<link rel="stylesheet" href="bower_components/components-font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="dist/mrFeedback.css" />
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="dist/mrFeedback.js"></script>
var feedback = {
title:"My box title", //mandatory
msg:"This component is cool!!!", //mandatory
close: true
};
var instance = $uiMrFeedback.open(feedback);
instance.msg = "Message modified dynamically";
instance.remove();
Configuration | Possible value | Description |
---|---|---|
mrFeedbackConfigProvider.defaultTheme | bootstrap mac windows10 ios android post-it post-it-alert |
You can set the default theme value in your module configuration doing: mrFeedbackConfigProvider.defaultTheme = "facebook" |
mrFeedbackConfigProvider.defaultAnimation | fade zoom slide-left slide-top flip |
You can set the default animation value in your module configuration doing: mrFeedbackConfigProvider.defaultAnimation = "zoom" |
Argument | Possible value | Description |
---|---|---|
title | A string that represent the title of the feedback. | |
msg | A string (text or html) that represent the message of the feedback. | |
theme | bootstrap mac windows10 ios android post-it post-it-alert |
A string that represent the theme used to render the box. The default theme depends on the browser user agent:
|
notificationType | default warning danger info success |
A string that represent the color of notification box. Valid only with theme = notification |
notificationDelay | A number that represents the delay (in milliseconds) after which the box should close automatically. Valid only with theme = notification | |
animation | fade zoom slide-left slide-top flip |
A string that represent the animation used to open and close the box. The default value is "fade". You can overrides this default value in your module configuration doing: mrFeedbackConfigProvider.defaultAnimation = "zoom". With modal:true the animation option is disabled. |
modal | true false |
A boolean use to open the box in modal state (with a layer that block interaction with other element). With modal:true the animation option is disabled. |
close | true false |
A boolean use to show or not the standard close button. |
closeText | A string that represent the text visible in the close button. | |
fnClose | An object in wich you can configure a function that will run when the standard button close is clicked. The field of the object are:
|
|
btnAction | An array of object that describe the buttons you want to create inside the box. Every object must contains:
|
|
appendTo | A string that represent a jQuery element to append the box. Default is "body". |
Theme
Notification type
Animation
Close button
Buttons Action
ShowAn array of object that describe the buttons you want to create inside the box. Every button must contains:
Auto Close
Is possible to set an option (autoClose:true) if you want dismiss the box when one of the button's action is clicked (works only with the option btnAction active)
You created instance n. {{$index}}
Close button
Auto close
The field with * are not modifieble after the creation of the box.