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).
0
votes
0answers
15 views
Editable field component for “select”?
I'm creating a generic editable field following the example on offical angular website https://docs.angularjs.org/guide/component. I want the component be able to handle any select options,
Be able ...
0
votes
2answers
37 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 ...
4
votes
3answers
441 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
22 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
30 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
0answers
35 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
votes
1answer
21 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",
"...
1
vote
0answers
20 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 ...
3
votes
2answers
3k 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
129 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 ...
0
votes
0answers
40 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 ...
1
vote
2answers
76 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
42 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
20 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
30 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 ...
...
0
votes
2answers
489 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
33 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
12k 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....
21
votes
4answers
11k 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 ...
2
votes
0answers
44 views
Directive cannot bound for component?
Update:
https://plnkr.co/edit/kbz5uimNZ6vKTiT9QB6a?p=preview is created for testing.
I have the following directive egFiles to handle the status of <input type="file" id="newFile" eg-files="model....
1
vote
0answers
33 views
AngularJS 1.4 states to 1.5 components migration and how to approach component based architechure
There are good articles that explains the significance of components and how to migrate existing directive to components with angularJS 1.5. I am working on a medium sized project with ui-router and ...
0
votes
0answers
24 views
Lower level ng-outlet get higher level ng-outlet param?
I'm using Angular 1.5 component and have the following $routeConfig code at top level.
$routeConfig: [....
{ path: '/details/:MyId/...', component: 'details', name: 'Details' },
And I can get ...
1
vote
3answers
37 views
Angular Component Tag Name to div
I totally hate to add tag names based on component names in my apps. I hate to do this:
<hero-detail hero="ctrl.hero"></hero-detail>
Isn’t it possible to use normal div tags instead? ...
1
vote
1answer
33 views
Angular 1.5 component not seeming to register
I am currently writing an app using Angular 1.5's .component() method. My component code is as follows:
(function () {
'use strict';
function controllerFn($state) {
console.log('...
8
votes
2answers
206 views
$translate.instant does not translate values in AngularJS component when component starts
With Angular Translate and $translate.instant() method I built AngularJS's select component with automatic switching between languages:
<translated-select
elements="$ctrl.values"
current-value=...
1
vote
1answer
50 views
Passing multiple 'button' parameters to Angular component
I'm creating a reusable item picker component using Angular 1.5. The picker has a search field and a list of items to choose from. An example use case for the picker is a popup where the user ...
1
vote
2answers
40 views
How can I pass a function with argument to a component?
I want to pass a function from the parent component to the child component and give it an argument that has also been given from the parent component to the child. (showOrHideSub="item.showOrHideSub(...
0
votes
1answer
40 views
The parameters of functions magically match up in Angularjs?
I'm new to angualarjs and just start to build a page using angularjs 1.5 component. I'm trying to understand the following example from pluralsight. Does angularjs extended javascript with partial ...
1
vote
1answer
43 views
Very strange angular template render issue
I have the following code in index.html.
......
<my-test-app></my-test-app>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/...
-1
votes
1answer
63 views
Angular $compile for dynamic content
Using Angular 1.5, I want to use a generic "overlay" component to display other components within a modal. I'd like to pass in other components to be rendered within the overlay.
I thought I could ...
1
vote
1answer
69 views
Where should I place code to be used across components/controllers for an AngularJS app?
Should it be associated with the app module? Should it be a component or just a controller? Basically what I am trying to achieve is a common layout across all pages within which I can place or remove ...
0
votes
0answers
27 views
AngularJS component attributes not recognised in WebStorm
WebStorm 2016.2.3 does not seem to recognise AngularJS component attributes in the way that it does with directive attributes:
Is there a way to set up WebStorm to recognise component attributes?
2
votes
1answer
49 views
how to select element inside angular1.5 component
For component, I can no longer refer to Elem or Attr like I used to in its father -- directive, by taking them as arguments inside link or post.
What is the best way to select element like I used to ...
3
votes
2answers
117 views
how to set header for each page using component in Angular 1.5
I started with Angular 1.5 component recently.
I am having various pages in my application. So I decided to create a <my-title> component which am using inside <my-header> component.
As ...
1
vote
1answer
35 views
Issue to filter on table
I have a JSON data like this:
[
{
"id": 6488,
"type": "table",
"content": "<table> <tbody> <tr> <td>First</td> </tr> <tr> <td>Second</td> ...
2
votes
0answers
131 views
Ui-router 1.0.0.beta1 $transitions.onSuccess from $rootScope.on('$stateSuccess',
In my AngularJS (v. 1.5.x), I'm converting my controller-based states to component-based states with ui-router 1.0.0 (currently in beta 1).
I'm having troubles catching state changes, that where ...
0
votes
2answers
82 views
Angular 1.5.x - Issue with nested components
First of all, I'm using components.
I have this "parent" component:
(function() {
'use strict';
angular
.module('parentModule', [])
.component('parent', {
templateUrl: 'parent.tpl....
4
votes
1answer
2k views
Pass object to component
I have created a component that needs to have a reference to the object for which the component was created. I didn't make to work and all my trials have failed. Below, I try to describe the intention....
1
vote
1answer
501 views
Multi-Level Component Callbacks in Angular 1.5
I am coming from a React / Redux mindset where data-manipulation functions as well as data are passed from parent to child to grandchild etc. Components themselves do not modify data, rather they pass ...
23
votes
5answers
14k views
What is best practice to create an AngularJS 1.5 component in Typescript?
I am experimenting with the .component() syntax in Angular 1.5.
It seems that the latest fashion is to code the controller in-line in the component rather that in a separate file, and I can see the ...
1
vote
1answer
40 views
reference form in angular component without scope
Currently I have this component definition:
var controller = ['$http', '$timeout', '$scope', function($http, $timeout, $scope) {
this.isInvalid = function() {
return $scope....
3
votes
1answer
213 views
D3.js 4 with AngularJS 1.5 ( Components or Directives ? )
i want to use D3.js v4 with AngularJS 1.5x
In the past i used .directives for the charts, but now i was wondering if it's possible use .components instead of directives, and if it's a good practice.
...
1
vote
0answers
41 views
Move from Server Based Application to Component Based SPA - Angular.js
Currently I have a Server Based Application running on MEAN Stack. I have node/express.js server and a backend API. Currently my structure is something like this:
Current Approach
Home Page
|...
0
votes
1answer
136 views
AngularJS one way binding component trigger 'Invalid controller bindings definition for directive'
I am getting this weird error when applying binding in an angular component:
Error: [$compile:iscp] Invalid controller bindings definition for directive 'workTimekeepingsDay'. Definition: {... ...
0
votes
1answer
245 views
How to pass ngModel to AngularJS component without 2-way binding?
I have custom input as AngularJS 1.5 component with one-way data bindings and ngModel as two-way data binding:
return {
bindings: {
form: "<",
fieldName: "@",
minLength: "...
0
votes
0answers
35 views
Filter not applied after changing filter parameter in component
I am blocked with a problem with angular two way binding and filter. I am using a filter by a parameter, and after the parameter value is changed in another directive, the filter is not applied. Here ...
0
votes
2answers
1k 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 ...
2
votes
2answers
154 views
Angular 1.5 Component Bindings: Check if Callback is Present
I've got a simple contactList component, which has 2 bindings: contacts and onRemove.
contacts is just an array of contacts to display
onRemove is a callback function
app
.component('contactList', ...
2
votes
1answer
39 views
Requiring directive's controller from component return an empty controller
So I have been trying to figure this out for the past 4 hours. Basically I have a parent directive which is being dynamically compiled into DOM
And within it I have a component which is being ...