constructor(private http: Http) {
//this.host = environment.host;
this.url = location.protocol + "//" + location.host + '/' + location.pathname.split('/')[1];
}
import {Directive, Input} from '@angular/core';
@Directive({
selector: '[scroll]'
})
export class ScrollDirective {
constructor() {
}
@Input('scroll')
set appScroll(isReady: boolean) {
if (isReady)
this.ngForCallback();
}
ngForCallback() {
$('.owl-carousel').owlCarousel({
loop: true,
margin: 10,
responsiveClass: true,
autoWidth: false,
navText: ["Предыдущий", "Следующий"],
responsive: {
0: {
items: 1,
nav: true
},
600: {
items: 3,
nav: false
},
1000: {
items: 5,
nav: true,
loop: false,
margin: 20
}
}
});
console.log('run');
}
}
.....
<div class="owl-carousel owl-theme">
<div class="item" *ngFor="let t of test; let l=last" [scroll]="l ? true : false">
<h4>{{t?.name}}</h4>
</div>
</div>
.....
if (isset($model->game_id) ){
$gameValue = ArrayHelper::map(Game::find()->where(['id' => $model->game_id])->all(), 'id', 'name');
}else{
$gameValue = [];
<?= $form->field($model, 'game_id')->label('')->widget(DepDrop::classname(), [
'data' =>$ gameValue,
'type' => DepDrop::TYPE_SELECT2,
'options' => ['multiple' => true],
'disabled' =>false,
'pluginOptions'=>[
'depends'=>['platform_id'],
'placeholder'=>'- ' . Yii::t('main', 'Select games') . ' -',
'url'=>Url::to(['/user/default/getgame'])
]
])
?>
private function getCountry($countryId = null){
if (isset($countryId)){
$result = Country::getDb()->cache(function ($db) {
return Country::find()->select('id, name')->asArray()->indexBy('id')->all();
});
return $result[$countryId]['name'];
}
return null;
}
Yii::t('frontend', 'About {name}', ['name' => '<strong>'.$model->name.'</strong>']),
'About {name}' => 'Подробнее о {name}',
...
$("#doc_step_table tr:last").before('<tr>' +
'<td>' + data['Document'] + '</td>' +
'<td>' + data['Number'] + '</td>' +
'<td>' + data['Issued'] + '</td>' +
'<td>' + data['Expiry'] + '</td>' +
'<td>' + data['CountryD'] + '</td>' +
'<td>' + data['Scan'] + '</td>' +
'<td>' + data['ScanR'] + '</td>' +
'<td><span data-row="'+data['TableID']+'" class="btn btn-danger edit pull-right">e</span></td>' +
'</tr>');
...