小编Tar*_*mud的帖子

在角度JS中搜索列表

我在一个页面中有一个搜索框,即header.html文件,我想要实现搜索功能的列表在另一个页面上,即content.html.那么在这种情况下如何使用angularjs搜索功能呢?下面是html代码.

了header.html

<div class="input-group col-md-12 search-inner-page ">
   <input type="text" class="form-control" placeholder="Search" name="q">
</div>
Run Code Online (Sandbox Code Playgroud)

content.html

<div class="surveyList" ng-repeat="survey in allSurveys">
    <span class="checkbox" ></span>
    <div class="toogleSurvey row" ng-mouseover="hoverIn()" ng-mouseleave="hoverOut()">
        <div class="col-xs-5 col-sm-2  col-md-2">{{survey.Name}}</div>
        <div class="col-xs-5 col-sm-1 col-md-1">{{survey.Type}}</div>
        <div class="col-sm-3  col-md-3 hidden-xs">{{survey.SurveyReference}}</div>
        <div class="col-sm-3  col-md-3 hidden-xs">{{survey.CreatedDate}}</div>
        <div class="col-sm-2  col-md-2 hidden-xs SurveyLastChild">{{survey.Status}}</div>
        <div class="hidden-xs surveyListTool"  ng-show="hoverEdit">
        <a class="editSurvey" title="edit"></a>
        <a class="deleteSurvey" title="delete"></a>
        <a class="exportSurvey" title="export survey"></a>
        <a class="menuSurvey" title="menu"></a>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

contentCtrl.js

angular.module("adminsuite").controller("surveyController",['getAllSurveyService','AuthenticationService', '$scope','$rootScope', '$state', function(getAllSurveyService,AuthenticationService, $scope,$rootScope,$state){

getAllSurveyService.surveyList().then(
function( data …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs

5
推荐指数
1
解决办法
1652
查看次数

标签 统计

angularjs ×1

javascript ×1