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 9146411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:44:40+00:00 2026-06-17T10:44:40+00:00

Accompanying plunker . I have an attribute-level custom directive in a div. The directive

  • 0

Accompanying plunker.

I have an attribute-level custom directive in a div. The directive has an isolated scope. Inside my div I have other directives that expect to be in the scope of the parent.

The issue is that the directives inside my div have access only to the isolated scope, not to the parent scope. I understand why, but I’m not clear on how to solve it cleanly.

I know that I can use transclude to solve this (see plunker) but this feels very sloppy. I have no need for a template, but I’d have to create one just for transclude to work, and transclude seems to be the only way to ensure that my nested directives have access to the correct scope.

Is there an alternative, cleaner way to do this?

To head off some possible questions:

  • I’m using an attribute-level directive instead of an element-level to make things easier for IE
  • I’m using an isolated scope because it’s a best practice – I don’t want to hose my parent scope by accident, and I want the directive to be portable.
  • 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-17T10:44:41+00:00Added an answer on June 17, 2026 at 10:44 am

    I’m really not sure what you’re trying to do.

    But what you’re actually doing is leveraging bidirectional binds on an isolated scope for ill-effect. It almost seems unrelated to your question.

    Anyhow… here is an update to your plunker

    Basically what was happening is inside of your isolated directive you need to use whatever name you’ve assigned in your scope declaration, in this case toggleOn().

    however if you want to you can do this. Basically just call $parent.colorToggle().

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

Sidebar

Related Questions

I have a grid of images with accompanying info in a sibling div that
I have just rolled a custom configuration section, created an accompanying schema document for
If I have 50,000-100,000 product skus with accompanying information, including specifications and descriptions, that
I have a Django application which includes a custom model field (and accompanying form
I have HTML content that generates a dynamic number of span elements with accompanying
I'm decoding a video format that has an accompanying audio track in a separate
I have a case class that has a few parameters for its constructor, and
I have two tables that can be seen in accompanying image. Table A contains
I have an .xml file which has an accompanying .xsl file. The output of
I have a project which has multiple Resource (resx) files along with the accompanying

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.