question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Namespace and Form issue

See original GitHub issue

When i use a form under a translate-namespace directive i couldn’t access my form from $scope in my controller, But he is happening in $scope.$$childHead instead. this is not a very welcome behavior. is it a normal behavior ?

version of angular-translate : 2.15.2 version of angular : 1.6.4

HTML

<div translate-namespace=".myComponentName">
     <form name="myFormName" action="" novalidate>
                <input type="email" required/>
     </form>
</div>

JS

function controller($scope){
      if($scope.$$childHead.myFormName.$valid){
      //do someting
      }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
knallicommented, Aug 10, 2017

Personally, I would recommend the last option, because I would always try not using $scope indirectly but a controller scope whenever it is possible. Well, yes, app (controller scope) is $scope.app actually, but I hope you got the point. That’s much more like Angular2 apps would be, and ensure data access is always being “with a dot”.

0reactions
AngularPlayercommented, Aug 11, 2017

I agree, i didn’t know we are able to do that, your last suggestion is just perfect 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Issue with namespaces and form names - Stack Overflow
I created a new project, in this project I made two folders one name Products and Clients , inside the folder Products I...
Read more >
"The type or namespace name 'ClassName' does not exist ...
Fixes an issue in which an incorrect minimally qualified name is generated for a public control in a Windows Form solution in Microsoft...
Read more >
.NET 5 Windows Forms Application, using double nested ...
The project builds successfully, and app runs fine without any issues after compiling. Just the Visual-Studio Designer stops working. I've installed .Net 5 ......
Read more >
Namespace Issues - Solaris System Management Agent ...
Namespace collision occurs if parts of the namespace delivered by different people have the same names. For example, two vendors might come up...
Read more >
XML Namespaces - w3resource
XML namespace solves this problem. It provides a way to distinguish between XML elements that have the same local name but are, in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found