@Directive({
selector: 'blurFocus',
//при focus на элемент применяется класс focus
host: {
'(focus)': 'setInputFocus(true)',
'(blur)': 'setInputFocus(false)'
}
})
setInputFocus(isSet: boolean): void {
this.renderer.setElementClass(this.elementRef.nativeElement.parentElement, 'focus', isSet);
}
this.input$ = Observable
.fromEvent(this._el.nativeElement, 'input')
.debounceTime(500);
this.input$.subscribe(event=> this._check(event))
<h2>Эр = {{someVar=(data.Tr * data.k * thr * data.q * data.a * data.b)}}</h2>
<h2>tчр = {{thr = (data.Oi * data.kt / 167 | number : 3) }} руб.</h2>эта переменная учитывает округление иначе:
h2>tчр = {{thr = (data.Oi * data.kt / 167) | number : 3 }}
var httpFactory = {},
cache = $cacheFactory.get('$http');
httpFactory.getInterest = function () {
return getWithCache('ref/user-interest')
};
function getWithCache (url) {
var mycache = httpFactory.getCache(baseUrl+url);
if(mycache) {
const _mycache = angular.copy(mycache);
var deferred = $q.defer();
deferred.resolve({data:JSON.parse(_mycache[1])});
return deferred.promise
}
else return $http.get(baseUrl+url, {cache: true})
}
var reader = new window.FileReader();
reader.readAsDataURL(blob);
reader.onloadend = function() {
base64data = reader.result;
console.log(base64data );
}
getWithCache(url, key, forceRefresh?:boolean):any {
if (!this[key]) {
this[key] = new ReplaySubject(1)
}
// If the Subject was NOT subscribed before OR if forceRefresh is requested
if (!this[key].observers.length || forceRefresh) {
this.get(url).subscribe(
(data) => this[key].next(data),
(error) => {
this[key].error(error);
// Recreate the Observable as after Error we cannot emit data anymore
this[key] = new ReplaySubject(1);
}
);
}
return this[key];
}
<button ng-click="i.show=1">button</button>
<span class="elem_list--descr--footer--item foot1"
ng-if="i.show==1">
<i class="icon clock"></i>
<span>{{::i.remain}}</span> {{::i._remain}} осталось
</span>
<div id="wrapper">
<aside id="sidebar-wrapper">
<menu-toggle close="1" class="sidebar_navigation">
<a ui-sref="projects" ui-sref-active="current" class="sidebar_navigation--link">
<span class="sidebar_navigation--icon icon1"></span>Проекты</a>
<a ui-sref="users" ui-sref-active="current" class="sidebar_navigation--link">
<span class="sidebar_navigation--icon icon2"></span>Пользователи
</a>
<a ui-sref="help({'id':'a1'})" class="sidebar_navigation--link">
<span class="sidebar_navigation--icon icon4"></span>
О CONSTART
</a>
<!--<a ui-sref="help({'id':'a3'})" class="sidebar_navigation--link">
<span class="sidebar_navigation--icon icon6"></span>
Стоимость услуг
</a>-->
<a ui-sref="help" class="sidebar_navigation--link">
<span class="sidebar_navigation--icon icon5"></span>
Помощь
</a>
</menu-toggle>
<div class="sidebar--footer">
<div class="social">
<a href="https://vk.com/constartru" target="_blank" class="vk"><i class="fa fa-vk"></i></a>
<a href="https://www.instagram.com/constart.ru/" target="_blank" class="in"><i class="fa fa-instagram"></i></a>
<a href="https://www.youtube.com/channel/UCOxuxxrAhiKB1U0RYQPB5FA" target="_blank"><i class="fa fa-youtube"></i></a>
</div>
<div class="copyright">© 2016 CONSTART <br> ООО "Констарт"</div>
</div>
</aside>
<nav-bar class="navigation"></nav-bar>
<section id="page-content-wrapper">
<ui-view></ui-view>
</section>
<footer>
<div class="footer_wrap">
<div class="footer--links">
<p><a ui-sref="help({'id':'a1'})">О CONSTART</a></p>|
<p><a ui-sref="help({'id':'a8'})">Контакты</a></p>|
<!--<p><a ui-sref="help({'id':'a3'})">Цены на услуги</a></p>|-->
<p><a ui-sref="help">Помощь</a></p>|
<p><a ui-sref="help({'id':'u1'})">Правила пользования платформой</a></p>|
<p><a ui-sref="help({'id':'a64'})">Пользовательское соглашение</a></p>
</div>
<div class="social">
<a href="https://vk.com/constartru" target="_blank" class="vk"><i class="fa fa-vk"></i></a>
<a href="https://www.instagram.com/constart.ru/" target="_blank" class="in"><i class="fa fa-instagram"></i></a>
<a href="https://www.youtube.com/channel/UCOxuxxrAhiKB1U0RYQPB5FA" target="_blank"><i class="fa fa-youtube"></i></a>
</div>
</div>
</footer>
</div>
<toast></toast>
<scroll-up class="btn_up"></scroll-up>
<form name="rl.form">
<div class="form-group">
<label for="">Введите email :</label>
<input type="email" class="form-control" required name="email"
ng-change="rl.check()"
ng-cut="$event.preventDefault()"
ng-copy="$event.preventDefault()"
ng-paste="$event.preventDefault()"
ng-model="rl.email">
</div>
<div class="alert alert-danger"
ng-if="rl.form.email.$touched && (rl.form.email.$error.required ||
rl.form.email.$error.email)">Введите правильный E-Mail
</div>
<div class="form-group">
<label for="">Введите повторно e-mail (во избежание ошибки или опечатки):</label>
<input type="email" class="form-control" required name="emailTwo"
ng-change="rl.check()"
ng-cut="$event.preventDefault()"
ng-copy="$event.preventDefault()"
ng-paste="$event.preventDefault()"
ng-model="rl.emailTwo">
</div>
<div class="alert alert-danger"
ng-if="rl.form.emailTwo.$touched && (rl.form.emailTwo.$error.required ||
rl.form.emailTwo.$error.email)">Введите правильный E-Mail
</div>
<div class="alert alert-danger" ng-if="rl.emailNotEqual">
Почтовые ящики не идентичны
</div>
<div class="alert alert-danger" ng-if="rl.emailOccupied">
Такой пользователь уже зарегистрирован
</div>
<div class="alert alert-success" ng-show="rl.allOk">
Почтовые ящики идентичны
</div>
</form>