Posts

angular - Angular2 calling a function in a sibling component -

component a i have form button should call service class. service returns extracted json result. compare() { this.getresults(); } getresults() { this.resultservice.getresults() .subscribe( results => this.results = results, error => this.errormessage = <any>error); } template of a: <form (ngsubmit)="compare()" #compareform="ngform"> <div class="col-md-5"> <h1>disk forensics</h1> <div class="form-group"> <label for="resourcea">disk a</label> <select ngbdropdown class="form-control" id="resourcea" required [(ngmodel)]="resourcea" name="resourcea"> <option *ngfor="let r of disks" [value]="r.id">{{r.name}}</option> </select> </div> <div class="form-gr...

html - Ionic + Angular + PHP Undefined property: stdClass::$variable in insert.php -

there 3 files. when submit button clicked in ionic page, send inputs controller, , controller parse insert.php. forms input datas saved when use html(without ionic contents), form sends empty data mysql database, when use ionic. errors found firebugs are: 1. response - notice: undefined property: stdclass::$firstname in insert.php 2. post (json) - there no child objects please me, below file. page 01 - <ion-content> <form> <br><br> <center> <ion-list> <!--step 1 billing details--> <div ng-repeat="group in groups"> <ion-item class="item-stable checkout item ng-binding active" ng-click="togglegroup(group)" ng-class="{active: isgroupshown(group)}"> <i class="icon" ng-class="isgroupshown(group) ? 'ion-minus' : ...

How to show "edit image" in Sitecore experience editor? -

in sitecore "content editor" can use "image editor" clicking "edit image" in data section, in experience editor not visible. there way make available editors use image editor? or behavior sitecore standard? picture field i've written in blog post . first you'll need add new button under /sitecore/system/field types/simple types/image/webedit buttons you can duplicate 1 of existing ones , change icon , text yourself. make contents of click field: chrome:field:editcontrol({command:"webedit:changeimage"}) (there's webedit:editimage can't name that). open app_config\include\sitecore.experienceeditor.config , duplicate entry webedit:chooseimage . change command name webedit:changeimage per above. change type class create below. if have access decompiler, take @ existing command sitecore.shell.framework.commands.shell.editimage existing command selecting image in experience editor sitecore.shell.applica...

javascript - Trying to include PHP code in Jquery droppable -

i'm building form builder cms , i'm trying access information database on dropped elements. the problem being; index file php , draggable/droppable element fetched javascript file variable. in js file tried adding variable want code executed: txtboxedit += "<? include 'db.php' ?>"; but output when element dropped: <!--? include 'db.php' ?--> any suggestions on how fix or maybe there's better way (probably is, haha). there "force" code outputted text? thx

c# - Unboxing and casting in one statement in generic method -

i have little utility method looks so: /// <summary> /// replaces dbnull value default of type specified /// </summary> /// <typeparam name="t">resulting type</typeparam> /// <param name="p_this">object check dbnull</param> /// <returns>p_this if not dbnull.value, else default(t)</returns> public static t replacedbnullwithdefault<t>(this object p_this) { return p_this == system.dbnull.value ? default(t) : (t)p_this; } in specific scenario, taking record out of data table , taking specific field out of using weak types, , specific field i'm getting long being boxed object . example reproduces follows: var obj = 2934l; int num = obj.replacedbnullwithdefault<int>(); it fails invalidcastexception , @ (t)p_this . i understand why, boxed long cannot cast directly int , , trying fails: object mylong = 234l; int myint = (int)mylong; however, unboxing , casting works fine: object mylong =...

javascript - How to decode json data to array value using jquery? -

i have below jsoncode {"0":{"category":"screensets","position":"top","rotate":"180","3d_file":"3d_deg_180.obj","height":"10","width":"10","x":"299","y":"166","current_roate":"0","comp_color":""},"width":"640","height":"640","name":"test drawing","size":"40","screen":"conference set"} how decode in array format using jquery? small example may full var j ='[{"id":"1","name":"test1"},{"id":"2","name":"test2"},{"id":"3","name":"test3"},{"id":"4","name":"test4"},{"id":"5","name...

css - Using calc() in table -

this question has answer here: using calc() tables 2 answers i trying use calc fix width of th:last-child differs others 15px. i've done is: th:last-child { width: calc( (100% - 30px)/12 + 30px ); } table, tr { width:100%; border: 1px solid black; height:10px; } th { border-right: 1px solid black; width: calc( (100% - 30px)/12 ); } <table> <thead> <tr> <th>column 1</th> <th>column 2</th> <th>column 3</th> <th>column 4</th> <th>column 5</th> <th>column 6</th> <th>column 7</th> <th>column 8</th> <th>column 9</th> <th>column 10</th> <th>column 11</th> <th>column 12</th> </tr> </thead> <tbody> ...