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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:52:57+00:00 2026-06-18T10:52:57+00:00

I have a flag I’m setting to true/false that changes the way some items

  • 0

I have a flag I’m setting to true/false that changes the way some items are being displayed on the page. I’m running into some trouble getting the value into my template and having it actually work though. The normal HTML (not inside the template) works fine.

restrict: 'E',
        scope: {
            speedDirection: "@",
            speedName: "@",
            value: "@",
            editElements: "="
        },
        template:
        '<div>'+
          '<p class="body-text">{{speedDirection}} '+
          '<input type="text" name="{{speedName}}" value="{{value}}" ng-show="editElements">'+
          '<span ng-hide="editElements">{{value}}</span>'+
          '</p>'+
        '</div>',

I would like to use the dynamic model value of editElements though, and not just the passed through value. That way when it changed it would reflect the update in the displayed template. The variable is defined in an object where I’m storing my test data:

function MyObject($scope) {
    $scope.editElements = true;

Is there any way to get this to work? I’ve tried passing it through (as above), using the “@” and {{editElement}} bit and so on. The custom HTML portion:

<speed-limit speed-direction="A to B:"
                    speed-name="reverse"
                    value="{{newObject.speedLimit[0]}}"
                    editElement="editElements">
                    </speed-limit>

UPDATE: I’ve installed Batarang and it shows the specific portion of my custom element (speed-limit) to have “editElement: null”. However the other areas editElements is referenced are correctly set. Is this some weird scope problem?

  • 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-18T10:52:58+00:00Added an answer on June 18, 2026 at 10:52 am

    As discussed in the comments, the same name can be used for the attribute’s name, but it must be snake-case, hence edit-elements=”editElements”:

    <speed-limit speed-direction="A to B:"
         speed-name="reverse"
         value="{{newObject.speedLimit[0]}}"
         edit-elements="editElements">
    </speed-limit>
    

    Don’t feel bad about this… I think every Angular developer has wasted at least one hour (or more) of his/her life on this.

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

Sidebar

Related Questions

I have a common validation function function connect_and_update_destination() { var flag = true; //
I have a web application that maintains a version flag as a ServletContext.setAttribute('flag', flagValue)
I have a flag that when passed to a switch statement needs different logic
I have a multidimensional array. And some of array's elements have 'inactive' flag. I
I'd like to have a debug flag in the Magento extension that I'm developing.
I have a flag attribute on each entity in a Core Data database that
I want to have a flag that could be accessible to read/write from different
I have a Card object, that has a flag isFlipped. I store them in
I'm using a shared host (fasthostingdirect) and for some reason they have this flag
I have a flag attached to my UserProfile record for logged in users that

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.