Questions tagged [angularjs-components]

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).

Component is an feature introduced in version 1.5.

From Understanding Components in the AngularJS documentation:

In Angular, a Component is a special kind of directive that uses a simpler configuration which is suitable for a component-based application structure.

This makes it easier to write an app in a way that's similar to using Web Components or using Angular 2's style of application architecture.

Advantages of Components:

  • simpler configuration than plain directives
  • promote sane defaults and best practices
  • optimized for component-based architecture
  • writing component directives will make it easier to upgrade to Angular 2

The applications built using the new framework are completely component-oriented. So using them in your application it's not only a good practice but will make your application closer to the new Angular style.

350 questions
0
votes
1 answer

using $http in component module angular JS

I'd like to understand why i can't retrieve data from external sources. I need to recover the content of a Json and parse it to display content in this template : Nombre of news: {{new.length}}
0
votes
2 answers

angular.js:13424 Error: [ng:areq] Argument 'fn' is not a function, got Object

I'm new to programming in html/JS/AngularJS. I'm trying to implement a simple angular component but i keep getting errors. I looked at other answers and can't find the solution why this simple implementation is creating the error in the console (the…
0
votes
2 answers

Passing directives to Component in Angular 1.5

I'm currently using Angular 1.5 library and wants to create a component for simple Text Box like below. Component JS 'use strict'; angular .module('components') .component('inputBox', { bindings: { label: '@', …
Venkat.R
  • 7,420
  • 5
  • 42
  • 63
0
votes
2 answers

How to react on changes in one way bindings

In the following snippet: angular.module('myModule') .component('myComponent', { controller : [ MyComponentController ], bindings: { input: '<' } …
Amio.io
  • 20,677
  • 15
  • 82
  • 117
0
votes
2 answers

Error registering Angular 1.5 component

I have the following Angular 1.5 component: (function () { 'use strict'; angular .module('EmployeeInformation') .controller('EmployeeDetailCtrl', EmployeeDetailCtrl) .component('employeeDetail', EmployeeDetail); var…
medievalgeek
  • 165
  • 9
0
votes
2 answers

Unable to pass data to AngularJS component directive

I'm trying to create a component directive using AngularJS 1.5. I'm passing the $scope variable defined in the controller to the component directive. But it's not rendering. Here is the component directive: .component('myComp', { scope: {}, …
iJade
  • 23,144
  • 56
  • 154
  • 243
0
votes
1 answer

Bind attribute only once (like bindonce)

On a component is it possible to bind in the style like bindonce? Please provide an example.
Amio.io
  • 20,677
  • 15
  • 82
  • 117
0
votes
1 answer

Understand Bindings in Components

I don't get the binding in angular components. I have reworked this material FAB demo to a component. So there is no ng-controller directive anymore. However I cannot make the bindings of bindings: {isOpen: '='} to work. I get the following error:…
Amio.io
  • 20,677
  • 15
  • 82
  • 117
0
votes
1 answer

Angular 1.5 component buttons and styling

As the "replace" configuration is deprecated in general and not available in the 1.5 angular.component I wonder what the best practice is to style the components and keep re-usability high. Example: app.component('changePasswordButton', { …
Stefan Norberg
  • 1,137
  • 13
  • 28
0
votes
1 answer

Get controller reference from callback using typescript

I have the following simple controller which using a directive/component and passing a function as binding. When the function being called I don't have reference to use any of the controller class services. In this case in my controller public…
-1
votes
1 answer

How to operate functions of component controllers from outside

I have a component with a function inside: app.component("myComponent", { templateUrl: "myComponent.html", controller: function() { this.addApp = function (arg) { console.log(arg); }; } }) I would like to…
georgeawg
  • 48,608
  • 13
  • 72
  • 95
-1
votes
1 answer

Where am I doing wrong in converting angularjs component into es6 class?

The options for chart are not coming. $onChanges method is not getting invoked. There is no compilation error though. I have executed the same without es6 convention. When I have converted this into es6 classes, I am facing this issue. Please…
-1
votes
1 answer

ng-repeat pass to the component

Hi i am very new to angularjs web development with typescript and really stuck with a problem. I dont think it should be a hard problem yet i have spent two days on it. I am trying to figure out how i can pass the value of an ng-repeat from a list…
J.k
  • 54
  • 4
-1
votes
2 answers

How to enumerate data returned from Observable Subscription in Angular 2?

I've the basic idea about how observable works, I'm able to get the data by calling subscribe method and render the data in my template. But I could not enumerate the data returned by the observable in my component. I would like to process my data…
-1
votes
1 answer

AngularJS, RequireJS and components after bootstrapping

I have a problem with my Environment of AngularJS, RequireJS and later loaded components. requirejs.config({ paths: { 'angular': ['//cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular.min'] }, shim: { angular: {…
Patrick
  • 829
  • 2
  • 13
  • 34
1 2 3
23
24