Component is a special kind of directive that uses a simpler configuration which is suitable for a component-based application structure. A Component cannot do any DOM manipulation like directives (in the link and compile methods).

learn more… | top users | synonyms

0
votes
1answer
27 views

Angular 1.5 Component Two Way Binding Not Working same using $ctrl

I have some products that I need show personalize with a component in my index.html. In the end I need totalize a grand Total of selected products in $scope main controller "planosVoz". But my two-way ...
0
votes
1answer
12 views

How to switch between components that uses ng-transclude?

Switching Between Components We have two components, <hello></hello> and <goodbye></goodbye>. Both components have transclusion, allowing them to be used in manners such as &...
2
votes
2answers
494 views

More than one template in same component in AngularJS 1.5

Can I use more than one template in AngularJS 1.5 components ? I have one component having one attribute, so I want to load different template based on that attribute name. How can I achieve loading ...
0
votes
1answer
24 views

Update Two Way Bound value $onDestroy in Angular 1.5 Component

I am creating a series of dynamic form components using AngularJS 1.5. I'm using ng-if to show and hide a form compoenent. When the component is destroyed, I remove it from and array in it's parent, ...
0
votes
2answers
67 views

AngularJS controller function not recognized

I have an AngularJS project with the structure shown in the first picture. I use custom tags defined as angularJS components. My main layout uses the custom tag by displaying it in a tab. The ...
0
votes
0answers
19 views

Converted AngularJS 1.3 directive to 1.5 Component Fails Silently

I'm converting an Angular 1.3 project built in .net to 1.5 components with typescript. I have a directive that I have boiled down to its simplest possible form. The directive looks like this: app....
0
votes
1answer
24 views

angularJS convert d3js custom donut directive to component

So I am trying to convert a directive to component. The directive basically renders a donut chart with legends when given an input dataset. Also when you hover on arc on donut I show popped up ...
0
votes
1answer
11 views

Testing angular sub-module can't find dependency

I'm trying to test my angular 1 (using typescript) modules, and I'm having issues with the dependencies: These are my modules: app.module.ts export const appModule: IModule = angular.module('app', [...
0
votes
0answers
16 views

Angular 1.5 component in Typescript not passing binding variable string

I am using Typescript with angular 1.5. I am having an issue passing a variable to a component to a binding. Here is the relevant code - I've stripped out most of the non-relevant code. module xyz....
0
votes
2answers
29 views

Controller reading component data

My idea is to create a big form from separated components. So this is my main template: <form novalidate> <div class="row"> <user></user> </div> <...
1
vote
0answers
38 views

AngularJS 1.5 component get parent ngModel

I can't change ngModel defined in $ctrl. It looks like this: 1. I have next code, defining component in index.html: <div ng-controller="appControllerData"> ... <div ng-controller="...
1
vote
2answers
2k views

AngularJS 1.5.x $onChanges Not Working with One-Way Binding Changes

I don't understand why $onChanges isn't kicked off when I change a bound primitive in an input. Can someone see what I've done wrong, and explain this in an uncomplicated way? I made a plunkr of a ...
0
votes
1answer
24 views

How can I handle isDirty in a component?

I'm using Angular 1.5 and am creating a custom drop-down. There are no elements that use ngModel involved. I want to be able to have a form know if my component is dirty, pristine, etc. My thinking is ...
1
vote
2answers
45 views

How to avoid old value flashed after view updated in Angular?

In my angular app, there is an main app component which have a event listener: ... $scope.$on('page::change', function(e, value) { self.navList = value; }); ... And a navigation component inside ...
-1
votes
1answer
45 views

access resolve in component controller in angularjs 1.5

I am trying to bind to an angularjs 1.5 component a resolve value without success, In the state definition, I have replaced the common value of template properties with a value of the name of my new ...
0
votes
1answer
43 views

How to properly bind object in 'bindings' using $compile in angular.js 1?

I want to dynamically compile component for inserting this to specific DOM element (DOM also dynamically created by 3rd party library). So, I use $compile, $scope. https://jsbin.com/gutekat/edit?...
0
votes
1answer
18 views

Error when using SVG in the component template

In this example, the error appears in the console: Error: <path> attribute d: Expected number, "M 100,{{$ctrl.test}} L…". angular.js:3505 See this error in the browser console (I use last ...
0
votes
1answer
36 views

Custom smart table maniupulation with AngularJS 1.5 components

I have an angularjs 1.5 setup with components. I have a smart table with a column that shows a couple values from my project list and I want to be able to, at the top, show the totals of these values. ...
1
vote
1answer
879 views

How to use angular 1.5 components with ui-router states

Right now, angular ui-router project didn't have anything explicit about angular 1.5 components. My project requirement is to use nested states and I want to use angular 1.5 components to easily ...
3
votes
3answers
59 views

angular component one-time binding from $http shows undefined

I'm new to Angular. I'm trying to use components (1.6). In the parent, I have an $http.get that gets data from a service and then assigns the response to a $scope variable. That scope variable is ...
32
votes
4answers
15k views

AngularJs 1.5 - Component does not support Watchers, what is the work around?

I've been upgrading my custom directives to the new component method.I've read that component's does not support watchers. Is this correct? If so how do you detect changes on an object. For a basic ...
-1
votes
2answers
29 views

Angular 1.5 - Component to retrieve html with data

I'm needing some help with Angular Component method. I have a main html with its main controller, in which i have a JSON list of client data like: clients: [{ "name": "John Jackson", "...
0
votes
1answer
45 views

AngularJS Components - How do I pass in a back end variable?

I'm trying to component-ise my codebase and have come up stuck on this problem. When using $scopes and Controllers I would pass a server token to my rest call method with ng-init. Trying to do the ...
0
votes
1answer
80 views

How to test Angularjs route's resolve value on component?

I'm using [email protected] and resolve some resource at the route level for one of my component. The component works as expected but my test fails now. Error PhantomJS 2.1.1 (Linux 0.0.0) module ag....
0
votes
2answers
487 views

What is a component in Angularjs?

I was doing some reading about directives and was wondering what the distinction was between a directive and a component, when I found that there are lots of components in Angularjs. There is a ...
0
votes
1answer
177 views

Angular 1.5 Component Example

I am fairly experienced using Angular pre-1.5, but I am currently starting to develop a web application based on 1.5 components. After much troubleshooting, I still can't seem to get a basic template ...
0
votes
0answers
24 views

Auto inject properties in Angular component to reduce boilerplate code

We are developing a large AngularJS (1.5) application which consists of a large number of constants that almost every Angular components' templates would use. Currently, we resort to manually assign ...
1
vote
0answers
25 views

AngularJS - Children component binded value not refreshed in ng-repeat

I have a parent component "transactionList" which get a list of banking transactions from an API and a children component "transactionItem" repeated for each transaction in this list. I encountered ...
3
votes
3answers
57 views

Command a specific child component from parent in AngularJS

I'm using AngularJS 1.5.8. I have "myParent" and "myChild" components. In my view, i've 1 parent and 2 children inside that parent. So my question is: I wanna have instances of children "myChild" ...
0
votes
0answers
53 views

ES6/AngularJs 1.5.5 directive/ngMessages Error: [$compile:ctreq] Controller 'ngMessages', required by directive 'ngMessage', can't be found

I am using angular.js 1.5.5 and ES6 My project uses gulp, webpack (I am mentioning this as I am not sure if this is causing any troubles around some exclusion/inclusion of angular-message.js in the ...
2
votes
2answers
578 views

Angular 1.5 component attribute presence

I'm refactoring some angular directives to angular 1.5-style components. Some of my directives have behavior that depends on a certain attribute being present, so without the attribute having a ...
1
vote
2answers
23 views

Which is more appropriate for Modes? Broadcast vs Binding?

I currently have a parent component and several children component. <parent-component> <child-component ng-data="$ctrl.object.fieldone"></child-component> <child-component ...
0
votes
1answer
77 views

angular-datatables - ng-repeat does not update datatable with new rows when $onChanges event called in component controller

I have made an angular-datatable component to be used in my project (using angular 1.5) and have bound the data it is populated with (the angular way) to an array of objects that gets updated in the ...
5
votes
2answers
3k views

angularjs components getting a form inside template

so I have a component with a template containing a form. mycomponent.html: <div> <form name="myForm"> <!-- more html code --> </form> </div> How can I ...
1
vote
2answers
33 views

How to keep a total between AngularJS Components in ngRepeat

Here's the problem - a limited number of licences can be assigned to users, when the available number is 0 no more can be assigned and other buttons will be disabled. Licences can removed and ...
0
votes
2answers
50 views

Using scope which can be shared between all components in Angular

I have simple controller with one method: app.controller('MyApp', function($scope) { $scope.myMethod() {...} } I have also many components for input fields (for example for text input, number ...
6
votes
3answers
564 views

template: unresolved variable or type $ctrl

How to tell PhpStorm/WebStorm that $ctrl in a template is known and also help it decide the controller it belongs to (maybe using jsdoc)? I create components in this manner in Angular 1.5: angular ...
0
votes
0answers
40 views

Replacing / overriding components in AngularJS using decorators

I have an angular_1.5 / Typescript project that follows ToddMotto style guide. Since I need to customize several components inside the modules (clients customizations), I have decided to structure the ...
0
votes
0answers
47 views

How to bind method from parent component to child in AngularJS

I'm creating simple parent-child components in AngularJS 1.5 but can't call method from my parent component in child component template through '&' binding: Parent component: module.component("...
1
vote
0answers
27 views

Bind an object between Controller and Component

I have a view where I use the component <cita-list citaFilterBinding="citaFilter"></cita-list>. The citaFilterBinding is the two way binding defined in the component and citaFilter is the ...
5
votes
2answers
4k views

Angular 1.5 components with ui-router resolve : Unknown provider

I'm facing an issue with converting controllers to components preparing my application for Angular 2, but the problem the migration is not going well, I have the ui-router to route between states and ...
1
vote
1answer
213 views

Dynamically assign templateUrl in angular component

I have an angular component I am building in angular 1.5. It looks like this: var module = angular.module("ncRelationshipSearch"); module.component("relationshipSearch", { templateUrl: <need ...
1
vote
2answers
194 views

AngularJS : ui-router components not showing

I am trying to write a simple angular application that uses angular ui-router to display components in my application. I can get it to work using templates and controllers, but when I refactor to ...
0
votes
1answer
58 views

Is it possible to invoke a component on ng-click?

Previously there was a <div>, the contents of which i was toggling on ng-click. With components in Angular 1.5, i moved the contents of the <div>and created a component. I want to load ...
1
vote
1answer
25 views

How to check if output binding is given?

How to check if output binding is given? Examplecode: angular.module('tester', []); angular.module('tester').component('test', { template: '<h3></h3>', bindings: { callback ...
1
vote
1answer
73 views

How to test this component / template ? :)

I looking for any help with my problem about my UNITEST for AngularJS (and nvd3). Indeed, when I try to make my chart I have an error. It's like $ctrl.data and $ctrl.options were completly empty ... ...
1
vote
2answers
622 views

Recursion in Angular 1.5 components

There are a couple of popular recursive angular directive Q&A's out there. An elegant solution is to abstracting the recursion functionality into a service And call it at directive 'compile' phase ...
0
votes
2answers
35 views

$http not injected into controller in a component after minification of JS file

angular.module("datasView",[]) .component("datasView",{ templateUrl : 'dataview/datasview.template.html', controller : function control($http){ var self = this; $http.get('src/...
11
votes
1answer
1k views

Angular 1.5 component dependency injection

I've been trying to use the new Angular 1.5 component syntax in a project, but I can't figure out how to inject a dependency into the component definition. Here's my attempt at refactoring an ...
11
votes
2answers
14k views

angularjs 1.5 component dependency injection

this may sound newb, but I have been following this tutorial for angularjs component. I am new to components and how do I inject a constant Utils or authService to my component like this? app....