back soft

مطالب مرتبط با «angular 2» (274 مطلب) در back soft | نویسنده: استخدام کار

How do I set returned Firebase data to a $scope variable in AngularJS?

Vote count: 0 What I am trying to do: I want to output all of the books in the book node on my home page. What I need is an array of objects that contain all of the books in the book node so that I can loop through them using the ng-repeat directive in AngularJs. In the code below, when I console log the data, I get an object of objects, which caot be used with ng-repeat. Another issue that I am having is when I try to output the $scope.allBooks variable on to the page, nothing appears. Can anyone help me with this? // Main Controller firebase.database().ref('books').on('value', function(snapshot) { var data = snapshot.val(); $scope.allBooks = data; console.log(data); }); // Book Node in Fir...

ادامه مطلب

angular $resource GET request not working

Vote count: 0 I made a RestAPI and I have the following in my node.js... router.route('/accounts') .get(function(req, res) { console.log("getted"); }); It is prefixed with api... app.use('/api', router); I tested it on PostMan to see if I can make a GET request and it worked using the following... http://localhost:3000/api/accounts Now I am trying to do the same thing from my services.js using $resource... app.factory('Profile', function ($resource) { var getToken = function(){ var get_account = $resource('http://XXX.XXX.X.XX:3000/api/accounts/:id', {id:'@id'}); get_account.get(); } retu { getToken: getToken } }); But now when I call Profile.getToken() I get the following error... ionic.bund...

ادامه مطلب

Gulp serve gives no reaction in Yeoman Gulp Angular

Vote count: 0 I am new to Yeoman and Gulp. Could someone please suggest a solution to the problem below: enter image description here Tried a lot of searching but none helped. I am using Windows 7 64-bit. If you think that I am using a bad generator, could anyone please suggest the best yeoman generator for Angular1? asked 21 secs agoJERRY THIMOTHY J Let's block ads! بخوانید...

ادامه مطلب

Accessing the Angular 2.0 ViewContainerRef for a popup created at runtime by a non-Angular library

Vote count: 0 Using Angular 2.0 (final), how can I obtain the ViewContainerRef of a DOM element created by an exteal, non-Angular library, after app/Component bootstrapping/rendering has occurred? I had previously used DynamicComponentLoader.loadNextToLocation(), but that was deprecated as of RC5. The Problem (TL;DR) I'm attempting to use Angular 2.0 to insert a dynamically-created Component inside of a popup window that is generated at runtime by an exteal, non-Angular library (specifically, an InfoWindow/Popup for an ESRI ArcGIS JavaScript API 3.x Map). Since the popup window is generated entirely by the exteal library after app bootstrap and the parent Component's ngAfterViewInit()/ngAfte...

ادامه مطلب

Using Filters in dynamic created data(array object) in angular controllers

Vote count: 0 static data is working with filters but having problem in dynamic data filtering Any and all help is appreciated. Thanks! asked 55 secs agoVikrum Bhalla Let's block ads! بخوانید...

ادامه مطلب

How to iterate formgroup with array in Angular2

Vote count: 0 I'm working on a model driven form and I can't get it to add items to a list being displayed with ngFor. I'm currently getting an error when trying to iterate my list. Error: Error: Caot find control with path: 'locations -> i' at new BaseException (exceptions.ts:21) at _throwError (shared.ts:80) at Object.setUpFormContainer (shared.ts:66) at FormGroupDirective.addFormGroup (form_group_directive.ts:74) at FormGroupName.AbstractFormGroupDirective.ngOnInit (abstract_form_group_directive.ts:37) at DebugAppView._View_PersonFormComponent4.detectChangesInteal (PersonFormComponent.ngfactory.js:3197) at DebugAppView.AppView.detectChanges (view.ts:260) at DebugAppView.detectChanges (vie...

ادامه مطلب

Angular Karma post has unexpected JSON

Vote count: 0 I have the following karma test. But I get the error "EXPECTED: {"data":{"form_field_17":"None Required","title":"Mr","firstName":"John","lastName":"Doe","email":"john@gmail.com","mobile":"1114269874","registration":"123","form_field_15":"Test","pref_date":"2016-08-30T02:13:00.000Z"},"formId":4} GOT: {"data":"{"form_field_17":"None Required","title":"Mr","firstName":"John","lastName":"Doe","email":"john@gmail.com","mobile":"1114269874","registration":"123","form_field_15":"Test","pref_date":"30/08/2016 12:13 PM"}","formId":4} Why does my JSON object have backslashes and my pref_date has changed format? describe('when submitting a form', function () { it('should be successful', ...

ادامه مطلب

NPM error installing Angular2

Vote count: 0 I have encountered the following errors trying to install Angular2 via Terminal. I checked Node and NPM and they are up to date. Terminal grab asked 1 min agoSpencer Millard Let's block ads! بخوانید...

ادامه مطلب

Angular google maps - Events on polygons created by drawing manager

Vote count: 0 I have been trying to implement polygons into google maps with the angular directive thing on top of it and am ruing into a couple of issues that I can't find solutions for in the docs. If I create a polygon with the ui-gmap-polygon directive then I can specify an events parameter which can link through to the controller where I can then run some javascript on click etc... However if the polygon is created by the ui-gmap-drawing-manager directive what do I hook onto? The only thing I can find in the docs is for events like "overlaycomplete" however I cant seem to get access to the actual polygon to trigger stuff on an on click event etc... Does anyone know a solution to this, I...

ادامه مطلب

Angular 2 Typescript @injectable

Vote count: 0 im using angular2 version 2.0.0-rc.5 and i create a file name userdetails.ts import {Injectable} from '@angular/core'; export interface userdetails{ userid: string, password: string, name: string, sbu: string, division: string, position:string, loggedin:boolean } @Injectable() export class Userdetails implements userdetails { public userid: string = null; public password: string = null; public name: string = null; public sbu: string = null; public division: string = null; public position: string = null; public loggedin: boolean = false; constructor(){ } isLoggedin(){ retu this.loggedin; } userSBUdetails(){ retu this.sbu; } getUserdetails(){ retu {userid: this.userid, password: ...

ادامه مطلب

How to make angularJS controller be active at all times?

Vote count: 0 I am developing an angularJS application where my geocordinates from the device are taken and sent to my REST service every few seconds. Code for geo coordinates sending is located in just one controller. It means that geolocation is only updated in my server if the template page for that controller is open. How do I make it so that geolocation is always updated regardless of which page I am on. Here is my code for that controller: .controller('geolocationCtrl', [ '$scope', '$http', 'geolocationFactory', function($scope, $http, geolocationFactory) { // constants should be uppercase var GET_PATH = 'https://temp-domain.co.uk/rest/rest.php/client/geolocation', PUT_PATH = 'https://...

ادامه مطلب

Create new page in angularjs blur-admin

Vote count: 0 According to the tutorial I've added new page and module, but it doesn't seem to work (neither it's shown in a sidebar, nor I can get it via direct url). What am I missing? asked 47 secs agoMichal_Szulc Let's block ads! بخوانید...

ادامه مطلب

Angular 2 - Ahead-of-time compilation how to

Vote count: 0 I'm trying to bootstrap my Angular 2 RC5 application following this guide https://angular.io/docs/ts/latest/guide/ngmodule.html Below is my code import { AppModuleNgFactory } from './app.module.ngfactory'; import {platformBrowser} from "@angular/platform-browser"; platformBrowser().bootstrapModuleFactory(AppModuleNgFactory); However , when I tried to compile typescript code, I got the following error appmain.ts(1,36): error TS2307: Caot find module './app.module.ngfactory'. How can I generate the app.module.ngfactory file? Which tool should I use? asked 1 min agoToan Nguyen Let's block ads! بخوانید...

ادامه مطلب

drag'n'drop adds aditional element .Angularjs

Vote count: 0 When I list items I need to show only items from ngRepeat. How to clear container element before list? Because now i have next (not good situation): 1.Item 1.1 Subiten When I drug 1.1 SubItem out of 1.Item. it shows next: 1.Item 2.SubItem 3 SubItem Here is html code: {{item...

ادامه مطلب

How to pass a string to Angular 2 (click) function?

Vote count: 0 I have a div element in my HTML like so next My question is : How to pass a string to the onPaginationlick() function ? when i try to pass it like this : next I have a parse template error. Enyone can help ? asked 49 secs agoNacim Idjakirene 1 Answer Vote count:...

ادامه مطلب

How routing and Ajax are different in angularjs

Vote count: 0 I am new to angular and I am trying to understand the routing concept , but I am getting confused routing is used to load some parts of the html from server if templateUrl is given in when method but even ajax does that it loads data in the form of JSON, XML or HTML from the server without reloading the entire page.So how are they different ? asked 17 secs agoYepMe Let's block ads! بخوانید...

ادامه مطلب

angularjs http service wait for data

Vote count: 0 I have HTTP service that retus promise to inspection2update.DamageTypeId property and continue to execute further. HTTP service: function post(objectTypeId, damageDescription) { var defer = $q.defer(); $http.post(serviceAddress + "save/" + objectTypeId + "/" + damageDescription).then(function (response) { defer.resolve(response.data); }); retu defer.promise; } Here how I call service in controller: inspection2update.DamageTypeId = damageTypesService.save(inspection2update.ObjectTypeId, self.dType); But I need to wait until I get data from service and only after it, to execute further. For this purpose I use $q service inside $http resolver, but still...

ادامه مطلب

AngularJs, What is better when creating a controller?

Vote count: 0 What is better when creating a controller in AngularJs: 1- angular.module('myApp') .controller('MyController',['$scope','dependencies','myService', function($scope, dependencies, myService ) { }]); 2- angular.module('myApp') .controller('MyController', function($scope, dependencies, myService ) { }]); asked 44 secs agoshireef khatab Let's block ads!...

ادامه مطلب

ng2-table angular2 rc4 HTML tags

Vote count: 0 I have a angular2 component which is generating data to populate my ng2-table, but I caot seem to put HTML tags into a cell. Instead the cell renders as such: (Don't have enough reputation to post as an image) http://i.imgur.com/9D2zaJs.png https://github.com/valor-software/ng2-table/issues/51 I've tried to modify the js file that is coming down as indicated as an older fix but changing the markup to the [ierHtml] angular2 element does not appear to be accepted. It seems that others are having this problem as well, has anyone else found a solution? I'm aware that ag-grid is capable of doing this, but we need to use ng2-table as it supports bootstrap pagination which ag-grid doe...

ادامه مطلب

Angular update button on timer

Vote count: 0 Hi I'm trying to update a button with the elapsed time. I can console log the timer, and update the button label once, but it's not updating with the time {{buttonLabel}} $scope.buttonLabel = "stop"; $scope.recordParams.timer = $interval(function(){ var time = getTimeElapsed(initialTime); $scope.buttonLabel = time; }, 100); i.e. it will change to 'stop' but I can't get it to update with the time. asked 39 secs agouser5839 Let's block ads! بخوانید...

ادامه مطلب

موضوعات مرتبط

How do set | do set returned | set returned Firebase | returned Firebase data | Firebase data to | data to scope | to scope variable | scope variable in | variable in AngularJS | How do