- Installing
- pipTranslate service
- pip-translate directive
- pip-translate-html directive
- pipError service
- pipTransaction service
- pipState service
- pipTheme service
- pipTimer service
- pipDebug service
- Questions and bugs
Add dependency to pip-webui into your bower.json or package.json file depending what you use.
"dependencies": {
...
"pip-webui": "*"
...
}
Alternatively you can install pip-webui manually using bower:
bower install pip-webui
or install it using npm:
npm install pip-webui
Include pip-webui files into your web application.
<link rel="stylesheet" href=".../pip-webui-lib.min.css"/>
<link rel="stylesheet" href=".../pip-webui.min.css"/>
...
<script src=".../pip-webui-lib.min.js"></script>
<script src=".../pip-webui.min.js"></script>
pipTranslate service enables translations of strings in web applications.
Before using the service, you shall define string resources in your components during configure phase:
var myModule = angular.module('myModule.Translate', []);
myModule.config(function (pipTranslateProvider) {
pipTranslateProvider.translations('en', {
KEY1: 'Text for key 1',
KEY2: 'Text for key 2',
KEY3: '<b>HTML</b> for <i>key 3</i>'
});
pipTranslateProvider.translations('ru', {
KEY1: 'Текст для ключа 1',
KEY2: 'Текст для ключа 2',
KEY3: '<b>HTML</b> для <i>ключа 3</i>'
});
});
Then you can all pipTranslate service to extract text by key translated for the current language:
// Set language
pipTranslate.use('ru');
pipTranslate.translate('KEY1');
Methods: Todo: Describe the service methods
pip-translate directive translates strings inside HTML page.
<pip-translate key="KEY1"/>
- key - key of resource string to translate
pip-translate-tml directive translates strings, but instead of text it injects HTML into a page.
<pip-translate-html key="KEY3"/>
- key - key of resource string to translate
When page communicates with server, it may perform several transactions at once. When failures occure, they may come in batches. pipError service allows to combine multiple errors in specific context. It also helps to decouple business logic that throws errors from UI that visualizes them.
Todo: Add code snippet that shows usage of the service
Todo: Describe service methods
When page communicates with server, it may execute multiple concurrent requests. pipTransaction helps to coordinate one or multiple concurrent requests and combine them into a single transaction. It also helps to decouple business logic that performs transaction from UI that visualizes transaction state.
Todo: Add code snippet that shows usage of the service
Todo: Add screenshot that shows how transaction state is visualized
Todo: Describe service methods
pipState service extends ui-router with few useful features
Todo: Add code snippet that shows usage of the service
Todo: Describe service methods
pipTheme service allows to change color themes in the application. Theme colors are defined in pip-webui-css module
Todo: Add code snippet that shows usage of the service
Todo: Add screenshot that shows how few themes
Todo: Describe service methods
Web applications often need to perform some tasks periodically - check new data on the server, refresh screen and so on. pipTimer service sends events in configured time intervals. That helps to minimize number of timers in the code and coordinate asynchronous processing.
Todo: Add code snippet that shows usage of the service
Todo: Describe service methods
pipDebug service allows to turn on/off debugging state and log debug messages when debugging is enabled.
Todo: Add code snippet that shows usage of the service
Todo: Describe service methods
If you have any questions regarding the module, you can ask them using our discussion forum.
Bugs related to this module can be reported using github issues.