Questions tagged [directive]
A concept of 'command' used by many programming languages and frameworks. Use this tag with a language and/or framework to indicate context. The C/C++ pre-processor is one language that relies heavily on directives. They call it "pragmas".
2,058
questions
0
votes
0
answers
11
views
Get all the scrollable elements in Angular
I'm working on Angular 14 and trying to create a directive that hide the element its on when scrolling in a different element.
I want to get all the scrollable elements, and then listen to them.
In my ...
1
vote
1
answer
27
views
How to get the current line in swift 5.0
I want to convert a codable struct into keyvalue pairs so that I can write it to a row in a csv so I can present it in excel, or apple numbers. I will need some of the cells in the csv to be ...
0
votes
0
answers
18
views
Listing all uses of own directive in Angular
I'm looking for way to list all instance of used my own directive [app-feature]='1' in whole application without visiting all sub pages.
Angular 14
0
votes
0
answers
15
views
NGINX Directive to hide Sub Directory and Path in the Address Bar
I have an app that is placed behind a reverse proxy and everything works. Unfortunately my app generates really ugly paths in the URL depending on what it's doing.
What directive settings should I be ...
0
votes
1
answer
30
views
How to use directive in more than one module in angular?
created one directive uppercase-input.directive.ts
and trying to import/use it in more than one components, but getting below error
just posted here one file (organization.module.ts), there are few ...
1
vote
0
answers
33
views
Angular 2+ directive - how to get nativeElement from child directive in the same or nested template
I'm attempting to create a directive to manage ARIA Web accessible tab events using Angular 2+, but I'm having an issue with Angular Directives.
I want to have hierarchical directives so I can specify ...
0
votes
0
answers
29
views
How write a regex that allows one letter followed by 7 numbers in a non blocking way
Let's imagine this situation : I have an input with a keypress event. On each keypress, I should accept the key if the first letter is a capital T, then accept every numbers from 0 to 9 until a total ...
-2
votes
0
answers
22
views
Unity 3d creating character movement - Error CS1061
I'm currently following a tutorial about game dev on Unity (by Natty Creations) and I'm getting an error which I cannot solve (sorry I'm very new to this and I don't know how things work). the error ...
0
votes
0
answers
24
views
I want to create a directive of date with angular materiel
I want to create a directive of date with angular materiel.
I had create the directive and put it inside the HTML, I called the directive from a page, when I click in the calender it can't be opened.
...
0
votes
0
answers
35
views
Understanding GraphQL Operations Fields and Directives
I'm a little confused about the difference between a graphql operation, fields and applying directives on those.
Eg:
extend type Query {
"""The Hello <Name>! query.""&...
1
vote
1
answer
27
views
i have a custom structural directive that using a promise in the ngOnInit to get an auth state from an API that doesn't refresh when i login or logout
I have a custom structural directive that using a promise in the ngOnInit to get an auth state from an API , that directive show or delete element based on an auth state that it gets from an API,
it ...
1
vote
0
answers
30
views
Is there any way to use substitutions to change the target of sphinx's autoclass function?
I'm documenting a method, and one of its parameters needs to be of a particular class. I therefore have the following code inside the method's docstring:
.. autoclass:: mymodule.classnumberone
...
0
votes
1
answer
28
views
Apache2: redirect using userdir http://website/~username -> http://{username}.other.website.com, URL gets cut off
I'm trying to use Apache2 userdir to redirect user home directories to external URLs, where the username is at the beginning of the URL (http://www.{USERNAME}.example.com/). The result is that ...
0
votes
1
answer
49
views
How do you convert a method into a multiline define directive in HLSL/C?
I'm trying to convert one of my methods into a multi-line define directive to implement the solution in this question: Can you use #defines like method parameters in HLSL?. However, I'm not having ...
0
votes
0
answers
12
views
I expected to see value in the section of View Child Value as i created a directive which is PaDisplayValue, but failed
<div class="bg-info text-white m-2 p-2">
View Child Value: <span PaDisplayValue> </span>
</div>
<div class="bg-info text-white m-2 p-2">
...
0
votes
0
answers
19
views
angularjs : ng-pattern-restrict doesn't work with custom directive
i have a custom-directive for inputs, this is the code:
moduloDirettive.directive('inputDir',function () {
return {
restrict : 'EA',
transclude : 'true',
replace: true,
...
0
votes
0
answers
39
views
How can i add directives in custom lit-element tags?
I've defined my custom button using lit-element.
I'm trying to use the button in an angular project to print, using the ngx-print library. This library needs triggers placed as directives:
<button ...
0
votes
0
answers
44
views
Angular: Get ViewChildren inside of directive
I have a component called SomeComponent. This component contains some Elements like a paragraph which has a template reference variable attached to it. Here is an example of SomeComponent
@Component({...
0
votes
0
answers
20
views
calculating total on form input with angular js
i found an error in my code, i want to make it calculate the value automatically based on what we input in the form. I want to calculate the total based on what I input, instead the system combines ...
0
votes
1
answer
21
views
Angularjs directive throws Unknown provider error after gulp minified js files
Thank you in advance!
I added custom directive to present field in phone number format. It works well untill gulp minifies the js files. After that it throws error
[$injector:unpr] Unknown provider: ...
0
votes
0
answers
34
views
Use of #define in CUNIT header file
While trying to learn CUNIT, I found the following in CUNIT header file Basic.h:
#define CU_EXPORT
CU_EXPORT CU_ErrorCode CU_basic_run_tests(void);
What is the purpose of CU_EXPORT?
Not sure what it ...
0
votes
2
answers
65
views
Extend and override default lighthouse directive
Is there anyway that I can override a directive like: src/Schema/Directives/WhereDirective.php for instance this doesn't support some methods on my custom builder, I know I can make another directive ...
0
votes
0
answers
47
views
CSP: Wildcard Directive
how to fix CSP: Wildcard Directive security issue in Angular
CSP: Wildcard Directive
i have added th CSP policy headers in nginx configuration and angular but still getting the medium priority errors ...
-1
votes
1
answer
52
views
What is the use of the argument of @Input and @Output decorators in angular?
Hi guys I hope you are doing well
lately I'm learning angular through a book and came across custom Directives,@Input and @Output decorators I totally understood how to use these latters very well
the ...
0
votes
2
answers
32
views
How to pass in a second input to a directive with a kebab case selector?
Say I have a directive that has a selector of selector: '[example-directive]'. Is there a way to pass in a second input to the directive? I've been able to succeed by changing the selector to selector:...
0
votes
0
answers
115
views
How do you access the another child element with Angular Directive?
I am using Angular directive to manipulate DOM.
For E.g.
HTML:
<div id="someHeadWrapper" appSomeDirective>
<div id="someSecondWrapper">Whatever...</div>
<...
0
votes
0
answers
307
views
How can I manipulate the Graphql query builder with a field directive? (Laravel, Lighthouse)
I am currently trying to add a field to my Variant type that, if added to the query, will cause the query to use a cross join, multiplying the results. I also have a lot of other, very weird and ...
0
votes
1
answer
51
views
how to make custom directive manipulate another elements in angular
my problem is i have a div that's visible and another div that's hidden what i want to do is to make the second div visible whenever i hover over the first div so i made a custom directive to help me ...
0
votes
0
answers
53
views
Type vue 2 directives
I will be quick. I am struggling to try to type the vue 2 directives to limit the number of values that can be passed to them but actually I cannot find any solution for my problem. Actually, I have ...
0
votes
1
answer
133
views
I'm trying to access a query list of child directive from a parent directive in the after view init method but the querylist remains undefined
QueryList of child directives remains undefined in ngAfterViewInit lifecycle hook.
What i'm I missing?
Here my code:
app.component.html
<main appDirOne>
<p appDirTwo>Main content</p&...
1
vote
0
answers
68
views
Lit Element - upgrading elements functionality in html
I'm learning Lit and I want to make some common functionality that can be added either when extending the element or when using html`` to make a TemplateResult.
Example
For example, I have a custom ...
2
votes
0
answers
81
views
Making a directive mandatory for every query/mutation
I am using github.com/99designs/gqlgen to create my GraphQL in Go. I have a directive in there called hasRole for authorization purposes. The thing is that I want to make this directive apply to every ...
0
votes
0
answers
122
views
How to add a click interceptor in Angular as globally as possible?
I'm working on a software that got quite huge over many years and we've noticed there are many buttons (or clickable elements like <a> and <img>) that aren't safe from double clicks. Since ...
0
votes
2
answers
611
views
Angular add dom element after current input in directive
I have two inputs:
<label for="date-string">String value</label>
<input [formControl]="dateString" type="date" id="date-string"/>
<br>
<label for=...
2
votes
1
answer
137
views
Include a custom directive into another custom directive
Following Sphinx TODO directive tutorial, I have made a Sphinx custom directive (let's call it A) that takes a file path as input, extracts information from this file, and produce nodes accordingly.
I ...
0
votes
0
answers
116
views
Infinite Scroll as directive in Angular
I need to create a directive containing the infinite scroll in angular. Any ideas? I don't really know how to go about it. Maybe some examples?
0
votes
0
answers
70
views
Segmentation fault due to memory access issue
When I run my f77 code, I get a segmentation fault due to memory access issue.
This is the message that my terminal outputs:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000f523b7 in ...
0
votes
1
answer
285
views
How Use @can with @paginate together in Laravel lighthouse
When I use @can in the query of getting all users like below I'm got an error that shows below:
getUsers(
first_name: String @like(template : "%{}%")
last_name: String @like(...
0
votes
0
answers
110
views
Test custom vue outside click directive in jest
I would like to write unit tests to test the behavior of my custom directive in one of my components.
<div class="value sidebar-item-value hide-collapsed">
<edit-form
v-if=&...
0
votes
0
answers
191
views
Only Characters Angular Directive is not working for Numeric Keys
I have a custom Angular directive for entering only characters without space in my "First Name" input field. I'm working on Angular 13 + Reactive Forms with Angular Material.
The code is ...
0
votes
0
answers
237
views
Alpha Numeric Directive is not working for Special Characters
I'm working on a Custom Directive in Angular 13 with Reactive Forms
as well as Angular Material.
I want the directive to allow only Alpha
Numeric values in my Employee Number input field. What I ...
0
votes
1
answer
302
views
Not able to pass Input value in my custom Directive - Angular [duplicate]
I am trying to pass some value in my custom Directive but when trying to do so, I am getting error
home.component.ts
<div *myNgIf myNgIfSomething="true" class="col-sm-6">
...
1
vote
1
answer
92
views
How to use validator directive with asynchronous call
I have created a validator directive that makes an HTTP request that checks if an email already exists.
I can see that the API call happening but in the template the validation is not working
...
0
votes
1
answer
79
views
Apache - deny non-local requests that match a specific URL pattern
I need to configure my Apache (2.4) in a way, that it prevents answering specific requests
I have an application that runs on a server myapplication.com.
Browsing the application triggers some further ...
0
votes
1
answer
80
views
Directive To Render Flutter Widget Role Based
I'm not sure how to implement directive in Flutter.
I have the following code in angular which creates directive to render element based on the role of user dynamicly. I want to implment in Fluter. ...
1
vote
0
answers
56
views
Is possible to add an implementation stub in this case?
I have a library X, and I'm adding wrappers around another library, say Y, in C++.
In all the source files, every time I add implementations using Y functionalities, I guard everything with an ...
0
votes
0
answers
478
views
Formatting Input Field type="text" in angular ( NgxMask, Amount )
I have following requirements for the visual formatting of an input field ( amount ):
Thousand seperator: " ' " ( Solved with ngxMask )
Limitseperator: 10 Digits ( Solved with ngxMask )
...
0
votes
0
answers
40
views
How to write directive to allow input field with type= text to allow 'words'?
enter image description here I am using ngxdatatable in reactive forms where user can update all the fields in the table. i have three fields/columns for e.g fields a,b and c and they are dynamic ...
0
votes
0
answers
89
views
Blade custom directive custom, passing dynamic expression as variable will not evaluate
Is there a way to evaluate a variable in a blade directive? I try to get the value of an associative array in function of dynamically passed arguments over directive
Having the following will fail
...
0
votes
1
answer
228
views
Access Component Attributes in Directive Vue
I have created a directive that is used in the component.
const disableSelectIfOneItem = {
inserted: function(el, binding, vnode) {
//want to access component attribute here
}
}
<v-...