我在一个页面中有一个搜索框,即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) 在我的应用程序中,我有7个复选框.我想获取所选复选框的值并存储到对象中.如果取消选择,我想在对象中删除它.
HTML
<span ng-repeat="days in selectDays">
<input type="checkbox" id="{{days}}" ng-model="daysSelected"/>
<label for="{{days}}">{{days}}</label>
</span>
Run Code Online (Sandbox Code Playgroud)
调节器
$scope.selectDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
$scope.selectedList = {}; //this is the object to store the selected checkbox values
Run Code Online (Sandbox Code Playgroud) 嗨,我在我的代码中收到“ ReferenceError:$未定义”。这是我的示例代码
$rootScope.$on('$stateChangeStart', function (event, next, current) {
// redirect to login page if not logged in and trying to access a restricted page
var restrictedPage = $.inArray($state.current.name, ['login']) === -1;
var loggedIn = $rootScope.globals.currentUser;
if (restrictedPage && !loggedIn) {
$state.go('login');
}
});
Run Code Online (Sandbox Code Playgroud)
这段代码是在run()中编写的;
我有一个登录页面.当用户提供用户名和密码时,我想加密密码并将其发送到服务器.我正在使用角度js应用程序,所以我想写角度的代码.请