angularjs-1.5

Ng-mock: $compileProvider doesn't have method 'preAssignBindingsEnabled`

↘锁芯ラ 提交于 2020-01-04 02:27:08
问题 I've been rewriting directives in Angular 1.5.8 to components. I want to write unit tests with '$componentController` just like described here: https://docs.angularjs.org/guide/component. The problem is that I'm getting error at this line: var ctrl = $componentController('componentName', null, bindings); saying: undefined is not a constructor (evaluating 'compileProvider.preAssignBindingsEnabled()') app/lib/angular-mocks/angular-mocks.js:2235:80 So it looks like $compileProvider doesn't have

Condition in ng- class not working

☆樱花仙子☆ 提交于 2020-01-03 00:18:13
问题 AngularJS I have scenario of applying class based on a condition in which I'm storing the value in rootscope dynamically and evaluating in html angular expression but still not working <li role="presentation" style="width:200px" ng-class="{active: true, inactive: false}[{{vm.$rootScope.currentPage}}==1]"><a href="#/create">Create</a></li> In inspect element if I check I can see 1==1 but still class is not getting active and if I remove {{vm.$rootScope.currentPage}} and place 1 it is working I

How to import an Excel file in to a database using angularJS1, hibernate(4.3.5), Spring(4.2.4)?

ぃ、小莉子 提交于 2019-12-24 20:42:26
问题 I want to import an Excel file into my database using angularJS1, Hibernate 4.3.5, Spring mvc 4.2.4. The Excel file is imported via a window (table consisting of children "last name, first name", and parents), the table was filled before manually. The goal now is to fill the table automatically by importing an Excel file. I can read the Excel file on google (json format), but I can not import it into my database. The project consists of a front part (angularJS1) and a back part (hibernate,

Why are my component bindings undefined in its controller?

两盒软妹~` 提交于 2019-12-20 09:26:40
问题 I'm writing a simple angular component. I'm passing a parameter as a binding and display its value on the screen. All works fine: I can see the parameter being displayed on the screen. Component: var app = angular.module("test", []); app.component("test", { bindings: { "contactId": "<" }, controllerAs: "model", controller: () => { //output: 'contact id from controller: undefined' console.log(`contact id from controller: ${this.contactId}`); }, template: "<div>Contact id from view: {{model

AngularJS 1.5+ Components do not support Watchers, what is the work around?

笑着哭i 提交于 2019-12-16 20:16:55
问题 I've been upgrading my custom directives to the new component architecture. I've read that components do not support watchers. Is this correct? If so how do you detect changes on an object? For a basic example I have custom component myBox which has a child component game with a binding on the game . If there is a change game within the game component how do I show an alert message within the myBox? I understand there is rxJS method is it possible to do this purely in angular? My JSFiddle

AngularJS 1.5+ Components do not support Watchers, what is the work around?

牧云@^-^@ 提交于 2019-12-16 20:16:32
问题 I've been upgrading my custom directives to the new component architecture. I've read that components do not support watchers. Is this correct? If so how do you detect changes on an object? For a basic example I have custom component myBox which has a child component game with a binding on the game . If there is a change game within the game component how do I show an alert message within the myBox? I understand there is rxJS method is it possible to do this purely in angular? My JSFiddle

AngularJS 1.5+ Components do not support Watchers, what is the work around?

天大地大妈咪最大 提交于 2019-12-16 20:16:03
问题 I've been upgrading my custom directives to the new component architecture. I've read that components do not support watchers. Is this correct? If so how do you detect changes on an object? For a basic example I have custom component myBox which has a child component game with a binding on the game . If there is a change game within the game component how do I show an alert message within the myBox? I understand there is rxJS method is it possible to do this purely in angular? My JSFiddle

Can $transclude be used to get interpolated text content?

非 Y 不嫁゛ 提交于 2019-12-13 17:21:46
问题 Is there a way to get transclude content after it has been interpolated using $transclude in a controller? I want the transclude to be performed without any alteration, but I need the interpolated value. For example I have a component that transcludes an interpolated string: <my-transclude-component>{{ vm.someTextToTransclude }}</my-transclude-component> Using $transclude in my controller I can do this to get the transcluded content, but it gives the uninterpolated value of {{ vm

How to update Parent Component data from Child Component without two way data binding in angular 1.5.x?

浪尽此生 提交于 2019-12-13 07:15:10
问题 Sorry if it's a silly question but i am a noob in angular 1.5.x I am using es6 class based components with one way data bindings throughout the app(best practices as far as i know). I have a Container Component . It has a Sidebar Component and a Content Component . I fetch the menu options (array or object) in Container Component and pass it to Sidebar Component and Content Component using one way data binding as attributes. I want to update the Container Component whenever i change menu

Bower dependency found in unit test Angular 1.2, but cannot be found Angular 1.5

柔情痞子 提交于 2019-12-12 22:24:53
问题 I have an issue while upgrading Angular from 1.2.28 to 1.5.5. The code itself runs like a charm, but my tests began to fail with the following message. Unknown provider: storeProvider <- store <- translateStorage I use "a0-angular-storage": "0.0.15" as a storeProvider which provides 'store' via angular.module('angular-storage.store', ['angular-storage.internalStore']) .provider('store', function() { ...} [EDIT:] removed all the code and referred to a github repo where i could reproduce the