Mohammad Hafiz Mohammad Hafiz - 1 year ago 98
AngularJS Question

search and display same page using angularjs

i need help to solve my problems.
can u help me for display my result after search using angularjs.


<form layout="column" ng-submit="submit(propertyquery)">
<span class="md-title" flex style="text-align: center;">
{{ 'title_filter' | translate }}
<md-input-container flex>
<md-icon class="md-primary">markunread_mailbox</md-icon>
<label>{{ 'title_property_no' | translate }}</label>
<input ng-model="propertyquery.propertyno"
type="text" />
<md-input-container flex>
<md-icon class="md-primary">account_balance</md-icon>
<label>{{ 'title_project' | translate }}</label>
<md-select name="projectid"
ng-repeat="propertyquery in projects"
{{ propertyquery.code }}
<md-input-container flex>
<md-icon class="md-primary">domain</md-icon>
<label>{{ 'title_block' | translate }}</label>
<input ng-model="propertyquery.block"
type="text" />
<md-input-container flex>
<md-icon class="md-primary">line_weight</md-icon>
<label>{{ 'title_floor' | translate }}</label>
<input ng-model="propertyquery.floor"
type="text" />
<md-input-container flex>
<md-icon class="md-primary">store</md-icon>
<label>{{ 'title_lot' | translate }}</label>
<input ng-model="propertyquery.lot"
type="text" />
<md-input-container flex>
<md-icon class="md-primary">credit_card</md-icon>
<label>{{ 'title_rental_rm' | translate }}</label>
<input ng-model="propertyquery.rental"
type="text" />
<md-input-container flex>
<md-icon class="md-primary">assessment</md-icon>
<div layout="column">
<span class="padding-radio">{{ 'title_status' | translate }}:</span></br>
<div layout="column">
<md-radio-group ng-model="propertyquery.status">
<md-radio-button value="VACANT"
{{ 'title_vacant' | translate }}
<md-radio-button value="UNDER MAINTENANCE"
{{ 'title_under_maintenance' | translate }}
<div layout="row" layout-align="end end">
<md-button aria-label="search"
class="md-primary md-raised"
ng-click="filter = '1'">
{{ 'action_submit' | translate }}


$scope.submit = function(propertyquery)
propertyunitno: propertyquery.propertyunitno,
projectid: propertyquery.projectid,
block: propertyquery.block,
floor: propertyquery.floor,
lot: propertyquery.lot,
rental: propertyquery.rental,
status: propertyquery.status,


after i click button submit the result will desplay into html. now i get the result from console. but i can't display the result into table.

do you think i need create new function for call the output?


<tr ng-click="read($event, property)"
ng-repeat="property in property">
<td>{{ $index + 1 }}</td>
<td>{{ property.propertyno | uppercase }}</td>
<td>{{ property.block | uppercase }}</td>
<td>{{ property.floor | uppercase }}</td>
<td>{{ property.lot | uppercase }}</td>
<td>RM {{ property.rental | uppercase }}</td>
<td>{{ property.status | uppercase }}</td>

how i can display the result after i click button submit.

Nix Nix
Answer Source

All I did below was set the result of the Propertyquery.query call to $

    .query({ /*.. your code above ..*/})

function _onQuerySuccess(data){
    $ = data;

Then update your template to be:

<tr ng-click="read($event, property)"
    ng-repeat="property in properties">

It was property but I think that is a typo:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download