In this Angular getting started guide, you'll learn how to use the Ribbon widget in an HTML project using HTML markup, jQuery script, and AngularJS directives.
For more complex samples that have the controller and model in separate files, see the AngularJS Directive Gallery on our web site.
Drop down and copy markup
Paste in your favorite text editor. |
Copy Code |
---|---|
<!DOCTYPE HTML> <HTML ng-app="MyApp"> <head> </head> <body ng-controller="MyController"> </body> </HTML> |
Drop down and copy references to paste inside the head tags
References |
Copy Code |
---|---|
<!-- jQuery --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js" type="text/javascript"></script> <!--Theme--> <link href="http://cdn.wijmo.com/themes/aristo/jquery-wijmo.css" rel="stylesheet" type="text/css" /> <!--Wijmo Widgets CSS--> <link href="http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20183.140.min.css" rel="stylesheet" type="text/css" /> <!-- Wijmo Scripts --> <script src="http://cdn.wijmo.com/jquery.wijmo-open.all.3.20183.140.min.js" type="text/javascript"></script> <script src="http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20183.140.min.js" type="text/javascript"></script> <!-- Angular --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script> <script src="http://cdn.wijmo.com/interop/angular.wijmo.3.20183.140.min.js"></script> |
Script |
Copy Code |
---|---|
<script type="text/javascript"> var app = angular.module("MyApp", ["wijmo"]); function MyController($scope) {} </script> |
Markup |
Copy Code |
---|---|
<wij-ribbon id="ribbon" style="width: 500px;"> <ul> <li><a href="#FormatTab">Format Tab</a></li> <li><a href="#CustomizeTab">Customize Tab</a></li> </ul> <div id="FormatTab"> <ul> <li id="actiongroup"> <button title="Save" class="wijmo-wijribbon-bigbutton" name="save"> <div class="wijmo-wijribbon-save"></div> <span>Save</span> </button> <span class="wijmo-wijribbon-list"> <button title="Undo" class="wijmo-wijribbon-undo" name="undo"></button> <button title="Redo" class="wijmo-wijribbon-redo" name="redo"></button> </span> <span class="wijmo-wijribbon-list"> <button title="Preview" class="wijmo-wijribbon-preview" name="preview"></button> <button title="Clean up" class="wijmo-wijribbon-cleanup" name="cleanup"></button> </span> <span class="wijmo-wijribbon-list"> <button title="Cut" class="wijmo-wijribbon-cut" name="cut"></button> <button title="Copy" class="wijmo-wijribbon-copy" name="copy"></button> <button title="Paste" class="wijmo-wijribbon-paste" name="paste"></button> <button title="Select All" class="wijmo-wijribbon-selectall" name="selectall"></button> </span> <div>Actions</div> </li> <li id="fontgroup"> <div title="Font Name" class="wijmo-wijribbon-dropdownbutton"> <button title="Font Name" name="fontname">Font Name</button> <ul> <li> <input type="radio" id="fontNameArial" name="fontname"/> <label for="fontNameArial" id="fn1" title="Arial">Arial</label> </li> <li> <input type="radio" id="fontNameCourier" name="fontname"/> <label for="fontNameCourier" id="fn2" title="Courier New">Courier New</label> </li> <li> <input type="radio" id="fontNameTimes" name="fontname"/> <label for="fontNameTimes" id="fn3" title="Times New Roman">Times New Roman</label> </li> </ul> </div> <div title="Font Size" class="wijmo-wijribbon-dropdownbutton"> <button title="Font Size" name="fontsize">Font Size</button> <ul> <li> <input type="radio" id="fontSizeSmall" name="fontsize"/> <label for="fontSizeSmall" id="small" title="Small">Small</label> </li> <li> <input type="radio" id="fontSizeMedium" name="fontsize"/> <label for="fontSizeMedium" id="medium" title="Medium">Medium</label> </li> <li> <input type="radio" id="fontSizeLarge" name="fontsize"/> <label for="fontSizeLarge" id="large" title="Large">Large</label> </li> </ul> </div> <span class="wijmo-wijribbon-list"> <button title="Background Color" class="wijmo-wijribbon-bgcolor" name="backcolor"></button> <button title="Font Color" class="wijmo-wijribbon-color" name="fontcolor"></button> </span> <span class="wijmo-wijribbon-list"> <input type="checkbox" id="fontStyleBold"/> <label for="fontStyleBold" id="bold" title="Bold" class="wijmo-wijribbon-bold"></label> <input type="checkbox" id="fontStyleItalic"/> <label for="fontStyleItalic" id="italic" title="Italic" class="wijmo-wijribbon-italic"></label> <input type="checkbox" id="fontStyleUnderline"/> <label for="fontStyleUnderline" id="underline" title="Underline" class="wijmo-wijribbon-underline"></label> <input type="checkbox" id="fontStyleStrikeThrough"/> <label for="fontStyleStrikeThrough" id="strike" name="strikethrough"title="Strikethrough" class="wijmo-wijribbon-strike"></label> <input type="checkbox" id="fontStyleSubscript"/> <label for="fontStyleSubscript" id="subscript" title="Subscript" class="wijmo-wijribbon-sub"></label> <input type="checkbox" id="fontStyleSuperscript"/> <label for="fontStyleSuperscript" id="superscript" title="Superscript" class="wijmo-wijribbon-sup"></label> </span> <span class="wijmo-wijribbon-list"> <button title="Template" class="wijmo-wijribbon-template" name="template"></button> </span> <span class="wijmo-wijribbon-list"> <button title="RemoveFormat" class="wijmo-wijribbon-removeformat" name="removeformat"></button> </span> <div>Font</div> </li> </ul> </div> <div id="CustomizeTab"> <ul> <li> <div title="Table" class="wijmo-wijribbon-splitbutton"> <button title="customize button" name="customcommand">Click Me</button> </div> <div>Customize</div> </li> </ul> </div> </wij-ribbon> |
Style |
Copy Code |
---|---|
<style type="text/css"> #actiongroup { width: 200px; } #fontgroup { width: 250px; } </style> |
MISSING WIDGET TYPE: The "Live Widget" Widget Type could not be found. The "Live Widget" Widget Type may have been deleted since this Widget was created. |