my app showing empty select field first entry. have read other solution given , tried still not working. my controller code is: .controller('usercreatecontroller', function(user,profile,auth) { alert("hello"); var vm = this; vm.type = 'create'; profile.all() //this service fetch profiles shown in select field .success(function(data){ vm.profile = data; }); vm.userdata.profile = vm.profile[0]; //here have set default value select field and html page is: <label class="col-sm-2 control-label">profile</label> <div class="col-sm-8"> <select ng-model="user.userdata.profile" ng-options="person._id person.profilename person in user.profile"> </select> </div> hierarchy of vm.profile { "_id": 46, "profile": objectid("5516498e95b84548156db754"), "isactive": true, "password": "$2...
i have perform simple task: want display piece of text inside rectangle , size of rectangle should precisely width of text. in c++, it's easy do. define qstring , apply qfontmetrics width. define rectangle graphics element have size. it's done within 5 minutes. i have heard qml easier use. therefore, expecting solve problem in less 5 minutes. didn't, , i'm still stuck @ it. here's have tried: rectangle { width: mytext.contentwidth height: mytext.contentheight text { anchors.fill:parent id: mytext font.family: "helvetica" font.pointsize: 50 text: qstr("the string want display") } } this doesn't work reason don't understand. have found way in way doesn't suits needs: rectangle { width: 100 height: 100 mousearea { id: mymousearea anchors.fill: parent onclicked: parent.width=mytext.contentwidth hoverenabled: true } t...
Comments
Post a Comment