Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:57:53+00:00 2026-06-17T15:57:53+00:00

i have resource in my controller and populate checkboxes with ng-repeat next thing i

  • 0

i have resource in my controller and populate checkboxes with ng-repeat
next thing i know in controller which are to be checked

code will looks like..

$scope.data = resource.query();

var arr_to_be_checked = [1,3,5];

in other controller i use this..

$scope.data = [ { Type: 1, checked: true, Title: 'Item A'},
                { Type: 2, checked: false, Title: 'Item B'}];

and its working fine but i need apply this on resource and ng-repeat because i need more flexible

i find any soulution but without point. Pls can you help me anyone?

My question is: How i can “override” objects in resource with ‘checked:true’ or set any checkbox as checked.

Thank you so much for help or any idea
Have a nice day

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:57:54+00:00Added an answer on June 17, 2026 at 3:57 pm
    <ul>
      <li ng-repeat="item in data">
        <input type="checkbox" ng-checked="item.checked"> {{item.Title}}
      </li>
    </ul>
    <button ng-click="checkItems()">Do</button> 
    

    .

    $scope.checkItems = function () {
      var i;
      for (i = 0; i < arr_to_be_checked.length; i++) {
        data[arr_to_be_checked[i]].checked = true;
      } 
    };
    

    PS: Please be really consistent on your naming conventions, javascript uses a camelCase naming convention, no underscores. Only constructor functions are named PascalCase

    Related API Documentation:
    ng-click
    ng-checked

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a resource Photos, which belongs to Adverts. In ActiveAdmin, users should be
Say I have a resource (e.g. a filehandle or network socket) which has to
I have made a resource. resources :dashboards I have a partial file which contains
I have the following route map.resource :account, :controller => users map.resources :users and /account/new
I have a Rails app with a Route resource, and a Route controller (not
I have a resource that inherits its table and controller from its parent. Its
I have the resource photos Currently I have this working: /photos which shows the
I have a resource Offering which has_many Allocations. Each Allocation belongs_to Account. I want
I have a resource 'User'. In it's controller there is an action 'choose'. Index
hi i have a problem with my routing in symfony. my routing_dev looks like:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.