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

  • Home
  • SEARCH
  • 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 9232289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:16:44+00:00 2026-06-18T06:16:44+00:00

I have directive with this template that includes a repeater: template: ‘<div class=btn-group>’ +

  • 0

I have directive with this template that includes a repeater:

template:   '<div class="btn-group">' +
                    '<a href="javascript:void(0)" class="btn" ng-repeat="option in options" ng-click="select($event, scope)" value="{{option.value}}">{{option.label}}</a>' +
                '</div>'

Inside my link function, the following returns an empty array unless I put it inside a $timeout:

var tmp = element.find('.btn');

Link to fiddle: http://jsfiddle.net/dkrotts/XF3RY/1/

Shouldn’t these elements be available at link time? If not, is there a cleaner way to handle this situation?

  • 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-18T06:16:46+00:00Added an answer on June 18, 2026 at 6:16 am

    Apparently the ng-repeat happens later, after your link function is run: https://stackoverflow.com/a/13771751/215945

    You may want to try using two directives, similar to the tabs and pane directives on the Angular home page example. The radio-buttons directive could define a method (using this) on its controller that the radio-button directive could call when clicked.

    For details on how the tabs and pane directives communicate, see https://stackoverflow.com/a/14168699/215945

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

Sidebar

Related Questions

I have a directive that looks at configuration to figure out what template to
I have a pretty simple directive that I want to load the template from
I have an aspx page that has a @Page directive which points to a
I have an IDL file that has a #pragma prefix directive, but whenever I
Accompanying plunker . I have an attribute-level custom directive in a div. The directive
Hi there I have this confirmable button directive which I am working on, The
I have an assignment that requires us to implement a doubly linked list class.
I currently have an angular directive that I have wrote to make file uploads
I have a T4 template that can output either optimized content or standard content
I have a lot of rules that look like this: cmd_BC = (dlm >

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.