angularjs - How to load (and update) an image whose URL is the sum of two forms -


i'm trying page image based on 2 forms: when enter page, url sum of 2 first entries of forms, when change them, image updates.

this code outputs "undefinedundefined" in label of placehold

app.js

app.controller('dtbctrl', function($scope, $http) {   $scope.selected1 = '1';   $scope.selected2 = '2';   $scope.one = [     {value: '1', label: '1'},     {value: '2', label: '2'},     {value: '3', label: '3'},     {value: '4', label: '4'}   ];   $scope.two = [     {value: '1', label: '1'},     {value: '2', label: '2'},     {value: '3', label: '3'}   ];   $scope.pic = 'http://www.placehold.it/1618x1000?text=' + $scope.one.label + $scope.two.value; }); 

page.jade

  .title title   .thumbnail     img.img-responsive(ng-src='{{pic}}')     .caption       .col-xs-12.col-sm-6.text-center         label label:          button.btn.btn-default.navbar-btn(type='button', ng-model='selectedone', bs-options='one.value one.label pitch in ones', bs-select='')           | select            span.caret       .col-xs-12.col-sm-6.text-center         label label:          button.btn.btn-default.navbar-btn(type='button', ng-model='selectedtwo', bs-options='two.value two.label 2 in twoes', bs-select='')           | select           span.caret 

and outputs nothing

page.jade

.content(ng-controller='dtbctrl')   .title title   .thumbnail     img.img-responsive(ng-src='{{pic + one.value + two.value}}') 

app.js

$scope.pic = 'http://www.placehold.it/1618x1000?text='; 

did mean use selectedone , not one?

img.img-responsive(ng-src='{{pic + selectedone.value + selectedtwo.value}}') 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -