mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
- Adding refresh page directive.
- Moving controller inside link function because it was not shared code anyways.
This commit is contained in:
2
res/app/components/stf/common-ui/refresh-page/index.js
Normal file
2
res/app/components/stf/common-ui/refresh-page/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
module.exports = angular.module('stf.refresh-page', [])
|
||||
.directive('refreshPage', require('./refresh-page-directive'))
|
||||
@@ -0,0 +1,12 @@
|
||||
module.exports = function refreshPageDirective() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
scope: {
|
||||
},
|
||||
template: require('./refresh-page.jade'),
|
||||
link: function (scope, element, attrs) {
|
||||
// TODO: reload with $route.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
describe('refreshPage', function () {
|
||||
|
||||
beforeEach(module('stf.refresh-page'));
|
||||
|
||||
var scope, compile;
|
||||
|
||||
beforeEach(inject(function ($rootScope, $compile) {
|
||||
scope = $rootScope.$new();
|
||||
compile = $compile;
|
||||
}));
|
||||
|
||||
it('should ...', function () {
|
||||
|
||||
/*
|
||||
To test your directive, you need to create some html that would use your directive,
|
||||
send that through compile() then compare the results.
|
||||
|
||||
var element = compile('<div refresh-page name="name">hi</div>')(scope);
|
||||
expect(element.text()).toBe('hello, world');
|
||||
*/
|
||||
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
button.btn.btn-sm.btn-primary-outline(ng-click='window.location.reload()')
|
||||
i.fa.fa-refresh
|
||||
span(translate) Refresh
|
||||
Reference in New Issue
Block a user