Tagged Questions
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).
1
vote
1answer
28 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
28 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
29 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
33 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
32 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 ...
7
votes
2answers
92 views
+50
$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=...
0
votes
0answers
19 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?
1
vote
1answer
34 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
42 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
31 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....
2
votes
1answer
28 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
87 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
28 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....
2
votes
1answer
74 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
24 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
83 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
30 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 ...
2
votes
2answers
60 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
32 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 ...
0
votes
1answer
62 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
0answers
11 views
How to access ngModelController in Angular1.5 components?
When I use angular.component() to create the brand new component that angular 1.5 provides, there's no link function, so the old way of injecting ngModelController or any other controllers doesn't ...
0
votes
1answer
34 views
Using the transclude clone attach function to add data accessible to transcluded content in Angular 1.5.8?
I'd like to make a few selected properties of my component's controller visible in the scope of content transcluded into that component. I'm trying to do that following Tero Parviainen's example for ...
0
votes
0answers
14 views
How do you set up an input for an AngularJS component where the input is a path to a view?
I am writing an AngularJS component that is essentially a container for other components. This container is located inside the main component of my app. Inside this container component, I have a ...
0
votes
2answers
54 views
How can I access the controller of a nested component from its parent?
I have three Angular 1.5 components: ReportFilter and ClientSelect, ZoneSelect.
ReportFilter has the two components inside of it
<!-- Report Filter -->
<div>
<client-select client=...
0
votes
2answers
60 views
Passing parent scope variables to ui-view component
I'm using angular-ui/ui-router and have directives/components with isolate scope defined to be rendered on state change.
$stateProvider
.state('about', {
url: '/about',
template: '<...
1
vote
2answers
58 views
Angular component relative templateUrl
I'm developing a modular angular application with I defined I folder path (constant : BASE_PATH : "path/to/folder") in angular-module-1 module. I want to re-used this constant in a angular component ...
0
votes
1answer
49 views
Set component TemplateURL to configured path
I am trying to set up a component with a templateURL that is a relative path given a configuration module. However, since it is outside of a controller, I can't figure out how to bring in the ...
3
votes
1answer
109 views
Pass bindings to TemplateUrl in Angular's component
My component object looks like this:
var options = {
bindings: {
title: '<',
rows: '<'
},
controller: registers,
templateUrl: function ($element, $attrs) {
...
1
vote
0answers
24 views
Using Inheritance with AngularJS Components
I am using AngularJS components in anticipation of eventually moving to Angular2. I have a component (Component1) that is essentially a dropdown with a few specific inputs and outputs. I have ...
0
votes
0answers
35 views
Angular JS - Resolve object can't retrieve in Controller
I am having some trouble injecting the resolved object into controller. I am using AngularJS 1.5 Component based + ES6 syntax
heres the routes.js file:
I want to get the resolved object garage and ...
0
votes
0answers
37 views
AngularjS Component inject service for building component object?
I have a directive in AngularJS 1.4:
app.directive('queryEditor', ['Util', function(Util) {
return {
scope: { .... },
restrict: 'E',
templateUrl: Util.templatePathFor('/templates/...
0
votes
1answer
41 views
How to toggle a class on the component-DOM-node
I'm currently rewriting some older directives to the new component-syntax. One of my directives needs to toggle a class on the DOMnode.
<my-directive ng-class="$ctrl.getClassList()">
<!-...
0
votes
0answers
68 views
Angular 1.5 clear child components from parent
Angular 1.5 application with a user input form. We have a custom shared component called a combo-box. It's essentially a drop-down selector but has css classes and a number of bells and whistles for ...
0
votes
2answers
88 views
Use resolve with angularjs component
I am trying to resolve a list of customers prior to rendering a page.
Here is the state provider reference, where I have the resolve methods.
angular.module('app')
.config(($stateProvider) => {
...
0
votes
1answer
27 views
Referencing Angular form with 1.5
I have an angular directive (1.4) I'm switching over to the component syntax (1.5). The existing code calls the form.$setPristine() if a form reset button is clicked. When I switch it to a component ...
0
votes
1answer
84 views
Require parent component in directive AngularJS 1.5
How to require a Component in a Directive? You can require the controller of a directive in another directive and you can require a component in another component. But how to require a components ...
0
votes
1answer
20 views
AngularJs 1.5 - unable to communicate between two components via parent component
I have 3 components in the following order: 1 parent component with 2 child components. I need to run a function within the parent component, by initiating it from either of the two child components.
...
0
votes
1answer
34 views
Angularjs pass simple string to component
I'm desperately trying to pass a simple string to an AngularJS component,
I have the following angularJS component:
async-typeahead.componenet.js:
angular.module('asyncTypeahead').component('...
0
votes
2answers
29 views
Set global constants in AngularJs
I am trying to create constants js file in angular js for an application. I am using below code to implement constants for entire application. It's working fine.
<code>
// app.js
angular....
0
votes
2answers
879 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 ...
7
votes
1answer
122 views
How to Identify whether a Angular2 component is completely loaded ( including ViewChilds ) when there is ngIf in template
Is it possible to Identify whether a Angular2 component (here AppComponent) is completely loaded ( including ViewChilds ) when there ngIf in template which conditionally loads the child.
Reference: ...
0
votes
0answers
55 views
How to Implement $compile(..)($scope) service inside angular 1.5 component, where $scope injectable is removed?
I am currently using Angular 1.4, in the process to shift to angular 1.5, I am rewriting all the controllers into component style and removing $scope injectables inside the controller. In one of the ...
0
votes
1answer
47 views
How to defined a new variable in AngularJS component
I have trying to create a AngularJS component corresponding to a progress bar. Here is a JSFiddle created for this question http://jsfiddle.net/Lvc0u55v/6725/
Here is my application and component ...
1
vote
1answer
47 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 ...
4
votes
2answers
63 views
Template not loading under component design
I am trying to make a single page application while using components since my company will be moving to using components in the future and I am trying to follow the angular-phonecat tutorial. The ...
0
votes
1answer
21 views
Drag and drop Angular 1.x directive/component and parent scope
Let's say my grandparent component/directive's scope variable is declared like this: $scope.g = { // methods here };
In each of my nested component's/directive's controllers, I'm referring to that ...
0
votes
0answers
32 views
Angular modal component
In the process of studying the angular implement widget modal window, but I do not quite understand how to do it correctly.
It is planned to write as a service, but something goes wrong.
The component ...
0
votes
0answers
57 views
Removing a AngularJS component from the DOM and from his parent on click
i'm trying to show a list of users in AngularJS
Each one would be user with a custom component element
The components would have TWO buttons
First one have to remove the component element from the ...
1
vote
0answers
57 views
Angular 1.5 component tree deep transclusion
I'm trying to figure out a way to use transclusion to provide a template for a deeply-nested component, from the top-level ancestor component. The idea being this component tree can be reused, but the ...
1
vote
1answer
68 views
Angular Components: What is the difference between one-way and attribute bindings?
I've been building a few angular components and was wondering what are the practical difference between the one-way ("<") and attribute ("@") bindings?
Are there scenarios where one is ...