Linked Questions
16 questions linked to/from @Directive vs @Component in Angular
13
votes
1
answer
3k
views
What is the difference between component and directive in Angular 2? [duplicate]
I've been struggling to understand what is the difference between these two concepts in the framework.
I'm well familiar with what directives in AngularJS 1.x are and both components and directives ...
1
vote
0
answers
93
views
Difference of communication between @Directive vs @component Angular 2.0 [duplicate]
What is the difference between a component and directive in angular2 .Both have a set of html template attached to it. And a set of controller or function which handles the functionality.
What are ...
0
votes
0
answers
46
views
Components in Angular are kind Of Directives? [duplicate]
As said,
Directives are instructions in the DOM
so as components work as the instructions in DOM too.
So that Means Components are Directives too but with a template
is it right to said so?
i am ...
100
votes
8
answers
95k
views
What is the difference between component and directive?
I have just started working with Angular 2.
I was wondering what are the differences between components and directives in Angular 2?
9
votes
4
answers
17k
views
What is the difference between a Decorator and Directive in angular?
I am so confused about Directives and Decorators in Angular. I thought anything prefixed with @ is a Decorator and now when i read about Directives it says, Component is a Directive. What's going on? ...
5
votes
2
answers
16k
views
Angular attribute component with value
Using Angular 6.0.7, I am creating an attribute component and injecting a value into it. For this I am following the answer here.
I want to know if there is a way, just like in AngularJS, to input a ...
2
votes
3
answers
6k
views
Angular 5: generate DIV instead of new tag from component
I'd like to know if there's a way to tell Angular to generate a DIV instead of a new tag when inserting a component in a router-outlet. Right now, I have this component code:
import { Component, ...
3
votes
3
answers
3k
views
Does an Angular 2 '@Component' decorator always need an element name selector?
In this example, from the official Angular 2 docs, the decorator looks like this:
@Component({
selector: 'my-app',
template: '<h1>My First Angular App</h1>'
})
Example: would prefer ...
11
votes
1
answer
5k
views
Is it possible to upgrade angularjs atttribute directives to use in angular 4?
I've been able to upgrade an angularjs element directive to be used in angular 4.
Here's a sample code:
[myScores.js]
angular.module('app.components.directives.myScores', [])
.directive('myScores', ...
2
votes
2
answers
4k
views
Extend ng-boostrap popover component with custom angular directive
What i try to achieve is to extend ngbPopover directive and wrap in custom directive all this proeprties so instead of showing them just to include my directive.
For example i am using ngbpopover ...
4
votes
1
answer
2k
views
Angular 2 @View with template vs @Component with template
I am hoping someone can clear this up for me. I am assuming there is an easy answer to this. But if its out on the internet I can't seem to find it. Keep in mind, I have little angular 1 experience, ...
-4
votes
1
answer
1k
views
Angular2: Difference between Decorators
I am new to Angular2 and want to clear some concepts as i referred many other post but still unclear. Issue is am not able to understand high level languages being used in tutorials so please can ...
0
votes
1
answer
1k
views
Angular 2 DOM Elements, "Use of Directives and Advantage of Directives over components
I have just started working on angular 2 and i need to know what are directives and what is the difference between and directives and components.
Also i need a basic idea on dom elements in angular 2.
0
votes
1
answer
468
views
When use a directive or reusable component on Angular 2 or Angular 4?
I have this following code:
<button class="btn form-control cayena-color-picker" btnCheckbox [popover]="myPopover" [ngClass]="selectedColor == null ? 'btn-default btn-fill' : selectedColor">
...
0
votes
1
answer
212
views
Angular - Component should render currency or date values
I have an Angular component and it is just a label which renders a value and if it has an associated pipe, the output of the pipe should be rendered as value of the label. But I don't want to declare ...