jeudi 23 mars 2017

Laravel 5 - angularjs ng-options set default value with laravel tags

I have a problem with laravel tags there I can't set a laravel value selected in ng-options. Can we help me please?

I don't understand how to work between laravel variable and angularjs together in this case.

{!!
    Form::select('store_id', [], ['class'=>'form-control'],
        [
            'ng-options' => 'store as store.fantasy_name for store in vm.stores',
            'ng-model' => 'data.store',
            'ng-selected' => "store.id == '$store->id'"
        ])
!!}

  • Obs.: The ng-model "data.store" is used to show store name. So I don't want move here.

  • References:

AngularJS - Set default value on select inside a ng-repeat

http://ift.tt/2nIz0ZN



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2mVAz29
via IFTTT

Aucun commentaire:

Enregistrer un commentaire