back soft

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

How to implement mock backend service and real backend service exist simultaneously in Angular2/4

Vote count:
 0In the angualr4 project, how to the part service use some of the mock back-end service, and the other part service try to call real background to achieve service.I registered in the app.module custom BackendProvider.The cli...

ادامه مطلب

Missing controls using Angular2 Reactive Forms

Vote count:
 0I'm ruing into a strange error with Angular2 and FormBuilder. The example I've put together has first name, last name fields along with a submit button. However, when run using Material, the two pre-loaded values display, but not the submit button. The submit button is ac...

ادامه مطلب

How to pass component value to Custom Directive Host Listener in angular2

Vote count:
 0I want to pass model value from my HTML template to my custom directive: @Directive({ selector: '[eventlistener]' }) export class EventListener { @Input() value:string = 'Not Defined'; @HostListener('click') onClick() { console.log('You clicked me',...

ادامه مطلب

Angular2 appear warning XMLHttpRequest at chrome

Vote count:
 0I used Http Restful API at Angular2, but appear the following waing message.Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.Please tell me how to...

ادامه مطلب

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

ادامه مطلب

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 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! بخوانید...

ادامه مطلب

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

ادامه مطلب

angular2 and nodeJs

Vote count: 0 I'm trying to crate and angular2 project with a REST service, using node. Although I found some tutorials/sample codes doing this kind of applications, the organization of the code/project is different form each other. I'm trying to figure out what's the best way so far to do that. Basically, what is the best approach to create angular2 project with nodejs back end? how should be the folder structure? where to put the angular code(with typescript)? how to use bower/gulp? asked 4 secs agonick Let's block ads! بخوانید...

ادامه مطلب

How make two-way of binding between grandchild and parent in angular2?

Vote count: 0 I need to do two way of binding between parent and grandchild. Thus, I try to do two-way of binding between child and other two. Some think like that GrandChild Child Parent But it does not work as I expect. This is my grandchild: ... export class FullScreenableSvgComponent { @Input() isFullScreen: Boolean; @Output() isFullScreenChange: EventEmitter; constructor() { this.isFullScreen = this.isFullScreen || false; this.isFullScreenChange = new EventEmitter(); } ... } This is my child: ... export class VisualizationComponent implements OnChanges, OnInit { @Input() isFullScreen: Boolean; @Output() isFullScreenChange: EventEmitter; constructor(private elementRef: ElementRef) { this...

ادامه مطلب

Internationalize and Localize option using Ionic2/Angular2

Vote count: 0 I am developing ionic2/angular2 app for Android mobile. I want to provide option to user to choose language option in the login page. Is there any way to do the app level Inteationalization using ionic2/angular2? I have seen so many examples with device level Inteationalization. asked 45 secs agovishnu This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.Recommended article from FiveFilters.org: Most Labour MPs in the UK Are Revolting....

ادامه مطلب

Angular2 - How to Condition Import, Does More Import Slow Down the Performance?

Vote count: 0 I have this: import {StepOnePage} from '../../pages/step-one/step-one'; import {StepTwoPage} from '../../pages/step-two/step-two'; import {StepThreePage} from '../../pages/step-two/step-one'; import {StepFourPage} from '../../pages/step-two/step-one'; import {StepFivePage} from '../../pages/step-two/step-one'; How can I put condition in these import statements? I tried to import in the constructor, so I can apply the condition: If currentStep is 'Step1' then import StepTwoPage however, it gives me this error: EXCEPTION: Error: Uncaught (in promise): Unexpected directive value 'undefined' on the View of component 'StepOnePage' Or I can import everything as another solution, howe...

ادامه مطلب

Ionic2/angular2 correct way of consuming service

Vote count: 0 I am leaing to build Ionic-2 app, I have a few components which consume services that make an http call and fetch some data, which in tu will be set in component and will finally be displayed in template. I overall understood the flow but I am making some logical mistake while coding it. My example component: export class FarmList { items: Object; constructor(private testService: TestService, public nav: NavController){} getData(): any { this.items = this.testService.fetchData() } nextView(){ this.nav.push(Farm) } showDetails(id: Number){ this.nav.push(Farm, { param1: id }) } } My corresponding service: @Injectable() export class TestService{ loading: boolean; data: Object; con...

ادامه مطلب

Is there an Angular2 view updated lifecycle hook?

Vote count: 0 I have a child component, receiving data from its parent and displaying text in a div. It is possible the parent sends undefined as data. When it does the div is supposed to transition its height to 0, which I do via css transition. As I don't know the length of the text, the div's height is supposed to be transitioned to auto. I found a code sample doing so, which I've transformed to fit into my component. export class LanguageDetail implements OnChange, OnInit { @Input() language: Language @ViewChild("detailPanel") detailPanel: ElementRef; private shownLanguage: Language; ngOnInit() { this.shownLanguage = new Language(); } ngOnChange() { if (this.detailPanel) { var detailPane...

ادامه مطلب

Angular2 @angular/router 3.0.0-alpha.3 - How to get the current route name

Vote count: 0 I'm trying to get the current route name in my app.component so that I can use the route name as a page class around a wrapper div. I'm trying to figure out the best way to handle this. Previously I was subscribing the the router changes property like I have listed below, but it seems like is no longer available with @angular/router 3.0.0-alpha.3. If anyone has any thoughts or suggestions I would be most grateful. this.router.changes.subscribe((val) => { var path = this._location.path(); if (path.indexOf('page-name') !== -1) { this.pageClass = 'page-name'; } }) asked 57 secs agoRyan Robison Let's block ads! بخوانید...

ادامه مطلب

Angular2 add styling when id of object > 100

Vote count: 1 I have object markers with all different Id's, now I want to set extra styling when the id > 100 Here the code is: {{ result.resource.display_name }} But how do I add extra styling like style="left: 12px" asked 6 mins agoBegierprogrammer 1 Answer Vote count: 1 You can bind to a style conditionally like or If you don't want to set a style at all if id noStyle = {}; gT100Style = {left: '12px'}; getStyle(id) { retu id > 100 ? this.gT100Style : this.noStyle; } It is important, that noStyle and gT100Style are defined outside getStyle() otherwise change detection would cause troubles because every call would retu a new style object instance. answered 3 mins agoGünter Zöchbauer Let's ...

ادامه مطلب

Karma Coverage not finding files (angular2 / typescript)

Vote count: 0 I am working on getting an app set up using Angular 2 w/ typescript and I'm having issues getting my karma coverage to find the files I want it to inspect. I've set this up successfully on an angular 1.x application but there seems to be another layer I'm missing with typescript. Everything runs just fine, I see all of my unit tests being checked by karma as expected and coverage says everything was okay and that my code has 100% coverage, which threw up a red flag. After checking the html output for coverage I saw that I have 100% coverage because no files are being checked. Looking at the output in my terminal I see that all of the files I have selected with patte: './src/**/...

ادامه مطلب

angular2 (angular2-seed) using paths in imports avoiding ../../

Vote count: 0 I'm using angular2-seed: https://github.com/mgechev/angular2-seed How to create a variable to use imports absolute link instead of relative, like this: import { MyService } from '@shared/services/MyService'; instead of: import { MyService } from '../shared/services/MyService'; to avoid relative import paths ../../... An example of this is the @angular import: import { Component, OnInit, ViewEncapsulation } from '@angular/core'; How is it defined? Can we do something like this for our shared folder? asked 1 min agosurfealokesea Let's block ads! بخوانید...

ادامه مطلب

Angular2 Global user object in every component

Vote count: 0 Hy! I am able to share Parent container's property via attribute directive and inputs, but it doesn't work if the child component is pulled in by . Any advice how to share with every component? Btw i get the global user with async call in the app.component. asked 2 mins agoSándor Veres Let's block ads! بخوانید...

ادامه مطلب

angular2 + typescript: is it possible to configure compiler to see my source code line in error stacktrace?

Vote count: 0 in Angular 2 project written in typescript and packaged with webpack I add e.g. following throw to welcome.ts file: @Page({ templateUrl: 'build/views/welcome/welcome.html' }) export class Welcome{ constructor(){ throw('something went wrong') } } In JS console, I see following error and stacktrace: EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error during instantiation of Welcome!. ORIGINAL EXCEPTION: something went wrong ERROR CONTEXT: [object Object]BrowserDomAdapter.logError @ browser_adapter.js?f9d6:77 BrowserDomAdapter.logGroup @ browser_adapter.js?f9d6:87 ExceptionHandler.call @ exception_handler.js?1ee2:57 (anonymous function) @ application_ref.js?7cf8:194 EventEmi...

ادامه مطلب

برچسب‌های مرتبط

how to iterate a map in java | how to iterate through a list in python | how to iterate through a list | how to iterate hashmap | how to iterate through dictionary python | how to iterate through a map in java | how to iterate in excel | how to iterate through a map c++ | how to iterate set in java | how to iterate through a string in java