back soft

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

Server side errors handling with angular-formly

Vote count: 0 I'm looking for solution on how I can display errors that the server respond, this is the respond for every invalid submission so I want to make the error handler in the app level and not in a controller. I want to display the errors both on the FORM level and on the field level. I have a REST API that in case of error retu the following JSON object: { "message": "Validation error: Validation notEmpty failed,nValidation error: Validation isEmail failed", "errors": [ { "field": "useame", "message": "Validation notEmpty failed" }, { "field": "email", "message": "Validation isEmail failed" } ] } How can I create a service that display the errors in case there is any? Thanks asked ...

ادامه مطلب

Angular2 - Release candidate router not routing to child routes

Vote count: 0 I am trying to create a simple nested router. This sort of structure worked in the beta builds, but with the launch of the release candidate router I find myself stuck. http://plnkr.co/edit/7KSJpqWuBpkxi1E6tJ The plunkr above is a contrived version of my scenario. Despite having @Routes([ new Route({ path: '/applications/...', component: ApplicationRouter }) ]) the router doesn't appear to be recognising the non-terminal route. Error: Uncaught (in promise): Caot match any routes. Current segment: 'applications'. Available routes: ['/applications/...']. asked 1 min agomattdotdev 1 Answer Vote count: 0 As far as I know in the new router /... isn't necessary for routes that have c...

ادامه مطلب

Angular2 RC with typescript and ASP.NET web api 2

Vote count: 0 I am looking for sample on Angular2 RC with typescript and ASP.NET web api 2 integration for CURD operations. Please share if anyone already tried this sample. Cheers Sanket asked 2 mins agoSanket Let's block ads! بخوانید...

ادامه مطلب

Not able to access the attribute of another div in HTML page using AngularJs

Vote count: 0 I am trying to pass value quest.quesId and questionOption.name to function checkScore. But it is coming as undefined(questionId, optionName). If same line is put inside ol then I am able to get the quest.quesId but this would not suffice the purpose. HTML page {{ quest.question }} {{ questionOption.option }} Check Score JS page var qnaModule = angular.module("qnaModule", []); qnaModule.controller("qaCtrl", function($scope) { $scope.questionJson = [{ "question": "What's your name?", "quesId": 1 }, { "question": "When was the universe form?", "quesId": 2 }] $scope.optionJson = [{ "option": "A", "quesId": 1 }, { "option": "B", "quesId": 1 }, { "option": "C", "quesId": 1 }, { "opti...

ادامه مطلب

Editable cell property of angular grid is not working

Vote count: 0 I am tring to make editable grid using angular. I want to keep few columns editable and few non editable. I have set the editable cell property to false for non editable cells but that is not taking effect here is plnkr http://plnkr.co/edit/p5xmu38QZiAO3Gjc35u0?p=preview asked 1 min agoJan.V Let's block ads! بخوانید...

ادامه مطلب

How to use an AngularJS controller from a controller.js file in html code

Vote count: 0 I am trying to use a controller that I wrote and saved in a controller.js file, but it won't work in my html code. I have the code written as: < div ng-app="myApp" ng=controller="movieCtrl"> ..bit of my html code.. < /div> < script src="controller.js"> But that doesn't work correctly, although it works if I just put the code for the controller inside the script tags instead of just putting the src="controller.js". How do I get it to work with that? asked 2 mins agoMike Let's block ads! بخوانید...

ادامه مطلب

Meteor Angular npm package handling

Vote count: 0 I'm trying to use Phantom JS in Meteor JS. Previously I have had issues using npm packages so it is possible I am approaching things in the completely wrong way. I referenced the Meteor guide and they suggest you import the package like I have done. Unfortunately when I uncomment line 4 I get this error: angular_angular.js?hash=c17a5a9…:83 Uncaught Error: [$injector:modulerr] Failed to instantiate module info due to: Error: [$injector:nomod] Module 'info' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. Here is my code: import angular from 'angular'; import angu...

ادامه مطلب

Angular2 detect presence of ng-content target

Vote count: 0 I have not seen how to do more complex stuff using content projection in Angular2. And the basic example i could imagine is some Modal that could have (or not have) header. You will have smth like: Modal template Usage: HEADER Content And the problem is: 1) i would like to hide header wrappers if header was not provided (e.g. hide "my-modal__header") 2) i would like to show some default header if header content is not provide (e.g. show "This is header" if header not provided or smth similar. How to detect presence of ng-content with exact target? I've done some plunkr to play around with example: https://plnkr.co/edit/QfBJjD3g82ksTjU5zVqw?p=preview asked 2 mins agoInviS Let's ...

ادامه مطلب

Angular 2 bootstrap multi root component

Vote count: 0 I would like to be able to boot multiple app root component into my index.html page. This was initially possible on angular 2 beta 0, but now in beta 17, it is not working anymore. Please refer to this code http://plnkr.co/edit/A7fyFUST9IdP1FriauXk?p=preview enter code here Hope somebody can modify the code to be able to work on angular 2 beta 17. Thanks in advance. asked 3 mins agomarvs Let's block ads! بخوانید...

ادامه مطلب

'socket.io error on connect: Error: xhr poll error' while importing zone.js when using Karma/Jasmine in Angular 2 with NativeScript 2.0 [1.7.1]

Vote count: 0 I'm getting the below error while ruing my tests using Karma with Jasmine in my Angular2 with NativeScript project. The tests are being executed correctly, but, this error keeps repeating in the console. I observed the error is coming only after importing zone.js (imported it because it says zone is not defined while using inject, etc from Angular2/testing). Error: JS: NSUTR-socket.io: transport error JS: NSUTR-socket.io: 1 JS: NSUTR: socket.io error on coect: Error: xhr poll error JS: NSUTR-socket.io: 2 JS: NSUTR: socket.io error on coect: Error: xhr poll error 04 05 2016 12:33:42.046:WARN [NativeScript / 23 (6.0; Google Nexus 6P - 6.0.0 - API 23 - 1440x2560)]: D iscoected (1 ...

ادامه مطلب

Disable specific dates based on selection in Angularjs date picker

Vote count: 0 I want disable same date based on selection without use max and min. For example I want to disable all mondays if select "One" all Sundays if select "Two". is it possible? some advice asked 4 mins agoSilvio Troia Let's block ads! بخوانید...

ادامه مطلب

Return a value from a nested success function in angularjs

Vote count: 0 I'm trying to retu a value from a nested function on my codes but it retu me undefined whenever i tried to display it. This is my codes: var calculateAlbum = function (albumPath,albumName) { retu photoService.getPhotos(albumPath,albumName) .success(function (data){ var status = data.myphotos.status; if(status == "ok"){ photoService.myphotosPhotoList() .success(function(data){ $scope.allPhotoListTotal = {}; var getAllPhotoList = data.config.nas_sharing; $scope.allPhotoListTotal = getAllPhotoList.count; }); } }); } Retu a value: calculateAlbum(albumPath,fileName).then(function(data) { var gettotal = $scope.allPhotoListTotal; console.log(gettotal); }); After retuing value in a con...

ادامه مطلب

Designing Angular custom form validations (multiple fields) generated by ngRepeat

Vote count: 0 I would like some feedback on improving/designing custom form validations(multiple fields) the Angular way. I have some form input fields that are generated by ngRepeat. Basically, the next input must be greater than the the previous. I called these fields beginLevel. My current implementation is as follow: I am using ngBlur to call a controller function. This function loops through my model comparing the index[i].beginsAtLevel with index[i-1].beginsAtLevel. In the event that the current beginsAtLevel is less than that the previous beginsAtLevel I grab the id of the form-group e.g. previousIndex = angular.element(document.querySelector('#beginsAtLevel' + (i - 1))); and currentI...

ادامه مطلب

Capital letters for directories and file names angular/node front end on linux

Vote count: 0 I am in the process of converting a front-end angular website from .Net/IIS to a Node/Linux environment. After removing all visual studio/.net files and setting up appropriate node routes I seem to have the project working again. However, when deploying to the linux aws server I am being told that the linux(unbuntu) back-end caot handle the pascal and camel casing in my angular file names and directories. Now I need to modify all of the naming to snake casing. Is there anyway around this since I have hundreds of files I would need to rename? Is this casing issue with linux accurate? I come from a Windows background so this is new to me. Thanks! asked 2 mins agoosiris355 Let's b...

ادامه مطلب

How ng-include builds url in Angular 1.5?

Vote count: 0 Am using Angular1.5 with asp.net mvc. By default when my application loads it points to http://domaiame/components/Webui/Home/Instructions Home - controller, Instructions - Action public class HomeController : Controller { public ActionResult Instructions() { retu View(); } } above url retus an html which contains below But it is not able to download the shell.html. it is generating the wrong url as below http://domaiame/components/Webui/Home/app/layout/shell/Shell.html In the above url why Home is coming ? My folder structure is app layout shell Shell.html Controllers Views Home Index.cshtml Instructions.cshtm Please correct me if anything is wrong. asked 2 mins agouser007 Let...

ادامه مطلب

How to extract a range of dates (most likely 2/3 weeks) from angularUI datepicker and display on page?

Vote count: 0 The angular datepicker has this default format: I need to customise this as follows. Let's say we have a range of dates: 05/03/2015 - 19/03/2015. I want to show the set of dates on the page as this: 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 Only those weeks which contain this date range. This need not be on a popup, even a simple implementation will do. Thanks in advance. :) asked 42 secs agoSatwiki Let's block ads! بخوانید...

ادامه مطلب

How to send input value from custom directive through $resource in Angular?

Vote count: 0 I've found answers about using ngModel within a custom directive, and I understand the concept, but I'm not sure if I am understanding how to implement it when using $resource. I'm successfully injecting the "file" scope into my directive, and I'm making the api call, but the value that's getting retued to my server is null. I'm sure my Angular directive implementation is where my fault lies. directive.js angular.module('pro').directive('buyLinkBox', function() { retu { restrict: "AE", replace: true, template: 'Buy Link for {{file.filename}}', scope: { file: '=', }, controller: function($scope, $route ,BuyLinkService){ $scope.sending = BuyLinkService.get({ FileId: $scope.file._...

ادامه مطلب

Error on get data API call using Angular

Vote count: 0 I am trying to get medicine name from TrueMD using api. I am using this from my localhost. For that reason web service security I also include 'Access-Control-Allow-Origin' as a null still same error of security. Is there somthing that I am missing? $scope.medicines = []; var search = "crocin"; var api_key = "API_KEY"; $http.get("http://www.truemd.in/api/medicine_suggestions?id=" + search + "?key=" + api_key) .then(function(response){ response.header('Access-Control-Allow-Origin', "null"); $scope.medicines = response.data; console.log($scope.medicine); }); asked 1 min agoAnudeep Let's block ads! بخوانید...

ادامه مطلب

how to bind and save td tag value in angularjs

Vote count: 0 I am trying to bind data from the controller by using the "ng-init = getNCandEmail()" function.And it was success.Now i want to save the binded values.Anyone please suggest a solution.The Code is given below. The Following Non Conformance has been Added/Edited NC Number: Incident Title:{{i.IncidentTitle}} Date&Time:{{i.IncidentDate |jsonDate}} Summary:{{i.Summary}} RemedialAction:{{i.RemedialAction}} ExactLoc:{{i.ExactLoc}} CompletedDate:{{i.CompletedDate | jsonDate}} asked 3 mins agosojan Let's block ads! بخوانید...

ادامه مطلب

mmenu angular > Infinite $digest Loop

Vote count: 0 Has anyone ever come across this scenario while using mmenu with Angular? 1) main canvas has buttons which onclick, launch popups (e.g. ngDialog, image editors, etc). 2) user opens the mmenu 3) user closes the mmenu (either by Esc or click close) 4) user clicks on the buttons to launch a popup 5) result: Error: $rootScope:infdig. Infinite $digest Loop Any ideas on how to troubleshoot/resolve? asked 1 min agocj780 Let's block ads! بخوانید...

ادامه مطلب