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.

Security Error on unit tests using onlyFromAutocomplete

See original GitHub issue

I’m submitting a … (check one with “x”)

[x ] bug report => search github for a similar issue or PR before submitting
[ ] support request/question

Current behavior

Using the attribute [onlyFromAutocomplete]=“true” raise a security error during unit tests.

Failed: Template parse errors:        Binding to event property 'onlyFromAutocomplete' is disallowed for security reasons, please use (lyFromAutocomplete)=...        
If 'onlyFromAutocomplete' is a directive input, make sure the directive is imported by the current module. ("
              [placeholder]="'Filter by area'"
              [secondaryPlaceholder]="'Filter by area'"
              [ERROR ->][onlyFromAutocomplete]="true">
              <tag-input-dropdown [showDropdownIfEmpty]="true" [autocomplet"): ng:///DynamicTestModule/MappingComponent.html@11:6        
parse@http://localhost:9876/_karma_webpack_/vendor.bundle.js:84997:80        
_compileTemplate@http://localhost:9876/_karma_webpack_/vendor.bundle.js:99149:44

We tried with the syntax onlyFromAutocomplete=“{{true}}”, a security error is still raised

Expected behavior No security error

What do you use to build your app?. Please specify the version angular-cli (1.3.2)

Angular version: 4.4.3

ngx-chips version: 1.5.3

Browser: Karma (1.7.1) with PhantomJS (4.0.5) powered by Chrome

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
yangjielcommented, Dec 12, 2018

Okay I am dumb, I forgot to import

TagInputModule, 
BrowserAnimationsModule,
FormsModule,
ReactiveFormsModule

in my test.

2reactions
seanmt13commented, Oct 25, 2017

Actually what i found that caused my issue was that i put [onlyFromAutocomplete] on the wrong tag. it needs to be on the <tag-input> tag.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Binding to event property 'onlyCurrentMonth' is disallowed for ...
In my project I have used Angular-7 after enable ivy in tsconfig.json showing error. enter image description here. My tsconfig.json file:
Read more >
Unit test not working on Xcode 14 … | Apple Developer Forums
Hello, When I lunch any Unit Test with Xcode 14 RC and iPhone 13 iOS 16 I get this error, any ideas?? Details....
Read more >
Writing unit tests in Java | Snyk
In this post, we'll learn how to install and use JUnit 5 to write unit tests for some Java code. We'll use the...
Read more >
unittest — Unit testing framework — Python 3.11.1 ...
unittest provides a base class, TestCase , which may be used to create new test cases. test suite. A test suite is a...
Read more >
jest unit test error on Binding to event property 'onLabel' - Telerik
I am creating unit tests using jest and I can't run the test because of Angular ... is disallowed for security reasons, please...
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