Re: [AngularJS] Adding directives attribute to @Component gives error

2016-09-23 Thread 'Lucas Lacroix' via AngularJS
Could you provide the actual code? I worry that you are including the angle brackets ("<" and ">") around the class name which would make it a cast operation. On Fri, Sep 23, 2016 at 7:30 AM Balaji Iyengar wrote: > Hi, > > I need to include a child component into a parent

Re: [AngularJS] Issues after migration to Angular2 final - Unexpected token

2016-09-21 Thread 'Lucas Lacroix' via AngularJS
To me, it looks like the error is coming from main.js, line 6. Index.html:17 is merely where that script is being loaded. On Tue, Sep 20, 2016 at 11:03 PM Navaneetha Krishnan S < snkrishn...@gmail.com> wrote: > I tried creating a sample project from quickstart in angular 2.0.0 in > aspnetcore,

Re: [AngularJS] Re: Angular2 - one route, multiple components

2016-09-15 Thread 'Lucas Lacroix' via AngularJS
Yeah. That's what I was thinking. On Thu, Sep 15, 2016, 05:15 Luke wrote: > Thanks, that's actually a great idea ! Just to make sure - in template of > the parent component, I have an ngSwitch on let's say a [ngSwitch]="type">, in it there are two child components

Re: [AngularJS] Angular2 - one route, multiple components

2016-09-14 Thread 'Lucas Lacroix' via AngularJS
Why not have an intermediate component that decides what type of thing to display? That seems the easiest way to do this. In other words, your route would go to the "figureOutType" component that contains a child component for each type of thing you might display. Then you can use ngSwitch to

Re: [AngularJS] Angular RC 7 changed the default TypeScript target for its @angular/core TypeScript sources

2016-09-14 Thread 'Lucas Lacroix' via AngularJS
This NPM module documents that PhantomJS does not support either ES5 or ES6. It includes steps on how to work around that issue. On Wed, Sep 14, 2016 at 9:28 AM kburjack via AngularJS < angular@googlegroups.com> wrote: > We were just upgrading from

Re: [AngularJS] Question about http service and observable

2016-09-12 Thread 'Lucas Lacroix' via AngularJS
I confirm nothing. Google does, however. On Mon, Sep 12, 2016, 01:55 Christophe HOARAU wrote: > Hi, > > Thanks, so you confirm there's not way to use the http service for > websockets or sse. > > > -- > You received this message because you are subscribed to the Google

Re: [AngularJS] Question about http service and observable

2016-09-11 Thread 'Lucas Lacroix' via AngularJS
Observables are a superset of promises and can be thought of as event streams. The http service returns an event stream that only emits one event (either an error or success) before finishing while others (like a websocket connection) would emit many. While promises allow for the single event

Re: [AngularJS] Attach Authorization Bearer JWT token for each API call

2016-08-26 Thread 'Lucas Lacroix' via AngularJS
I had a similar question and never found a good answer. I ended up creating my own service which is just a wrapper around the HTTP service. It's a bit of boiler plate, but it works. Additionally, because I'm using OAuth2 tokens instead of JWT, I was able to add in the functionality of renewing the

Re: [AngularJS] Failed at the angular-car-app@1.0.0 start script 'concurrently "npm run tsc:w" "npm run lite" '

2016-08-26 Thread 'Lucas Lacroix' via AngularJS
Try: npm i concurrently --save-dev On Fri, Aug 26, 2016 at 12:44 PM Edson Lima wrote: > Estou iniciando meus estudo com Angular e estou seguinte este tutorial: > > http://ntakashi.net/angularjs-2-0iniciando-uma-aplicacao-e-ambiente/ > > Quando tento executar a aplicação

Re: [AngularJS] Send Message for other component

2016-08-26 Thread 'Lucas Lacroix' via AngularJS
It almost sounds like you want a modal dialog. If that works for you, you can check out the one available from bootstrap: http://valor-software.com/ng2-bootstrap/#/modals On Fri, Aug 26, 2016 at 12:39 AM Luan Garrido wrote: > Hello everybody. > > Im trying to send a

Re: [AngularJS] What do you call the collective name for the different javascript-file based entities?

2016-08-24 Thread 'Lucas Lacroix' via AngularJS
I would call that and "application". On Wed, Aug 24, 2016 at 11:42 AM Richard Kandora wrote: > I'm talking about the collective name for services, directives, > components, controllers, factories. There doesn't seem to be an overarching > name that refers to all of

Re: [AngularJS] How to configure for different environments?

2016-08-24 Thread 'Lucas Lacroix' via AngularJS
You should have a configuration file (ex. A JSON file) that contains the configurable parts of the uris. That file could then be directly included in the html (using server side templating) or retrieved dynamically with an ajax call back to the host your software runs on. I've seen both used. On

Re: [AngularJS] Re: Property 'toPromise' does not exist on type 'Observable'. any

2016-08-23 Thread 'Lucas Lacroix' via AngularJS
I don't think this is a common issue. I've been using Observables and have never run in to this. Try reproducing in plunkr. On Tue, Aug 23, 2016 at 8:10 PM Madhav Patel wrote: > I am also having the same problem. has anyone found the solution ? Please > share. > > Thanks.

Re: [AngularJS] Re: Using outside Objects in a Angular2 Service

2016-08-22 Thread 'Lucas Lacroix' via AngularJS
You're declaring an interface, not a global. Try this article: http://stackoverflow.com/questions/13252225/call-a-global-variable-inside-typescript-module On Mon, Aug 22, 2016 at 12:51 PM Kameron Berget wrote: > Thank you. I have created an interface and imported it as

Re: [AngularJS] $http.get fails

2016-08-21 Thread 'Lucas Lacroix' via AngularJS
This is, most likely, an issue with CORS - code running on your web page is not allowed to make Ajax calls to another domain name. Here is an article on CORS. On Sun, Aug 21, 2016 at 12:45 AM Lakmi Nimi wrote:

Re: [AngularJS] Http Call with URL having special characters like underscore and dot

2016-08-20 Thread 'Lucas Lacroix' via AngularJS
Then those are valid characters and the error is in your server. On Sat, Aug 20, 2016, 11:17 PRao wrote: > I tried but encodeURIComponent does not seem to encode underscore and > period. > > > On Saturday, 20 August 2016 20:10:51 UTC+5:30, Lucas Lacroix wrote: > >> Use

Re: [AngularJS] Http Call with URL having special characters like underscore and dot

2016-08-20 Thread 'Lucas Lacroix' via AngularJS
Use the globally available encodeURIComponent function to encode the values in your query parameters. On Sat, Aug 20, 2016, 01:42 PRao wrote: > Hi - I am trying to make http call with url having special characeters > like underscore and period > Like

Re: [AngularJS] Re: conditional view

2016-08-19 Thread 'Lucas Lacroix' via AngularJS
I, personally, like to use the route for the search itself. That way, a user can save a search and/or share it with others. So, maybe something like: /search/?by=serialnumber=XYZ That would route to your search component which would execute the search and use ngSwitch on the "by" parameter to

Re: [AngularJS] Re: READING A JSON FILE USING $http SERVICE AND $routeProvider FOR NAVIGATION

2016-08-16 Thread 'Lucas Lacroix' via AngularJS
You really need to use a web-server. Loading applications from the local file system will break if XMLHttpRequest is used - note that it is used when loading modules. On Tue, Aug 16, 2016 at 11:03 AM Godwin Festus wrote: > > > On Tuesday, August 16, 2016 at 7:07:20 AM

Re: [AngularJS] READING A JSON FILE USING $http SERVICE AND $routeProvider FOR NAVIGATION

2016-08-16 Thread 'Lucas Lacroix' via AngularJS
It's better if you put this stuff in a plunkr... That aside, there are a few things to look at: Are you using a web-server? 1. If so, is the web-server configured to return the correct MIME type for JSON files? 2. If not, XMLHttpRequest's do not work when loading a page from disk.

Re: [AngularJS] NG2: dynamic input types, i.e: checkbox, radio, or text...

2016-08-13 Thread 'Lucas Lacroix' via AngularJS
Sorry... Those should be square brackets, I think. On Sat, Aug 13, 2016, 16:07 Lucas Lacroix wrote: > Did you try using a binding? > (type)="q.type" > > On Sat, Aug 13, 2016, 15:50 p. stephen w wrote: > >> I can't dynamically set the input type,

Re: [AngularJS] NG2: dynamic input types, i.e: checkbox, radio, or text...

2016-08-13 Thread 'Lucas Lacroix' via AngularJS
Did you try using a binding? (type)="q.type" On Sat, Aug 13, 2016, 15:50 p. stephen w wrote: > I can't dynamically set the input type, like so... > [(ngModel)]="ng2Form[q.id +'_'+ a.id]" > name="q.id" > value="a.score"/> > > Per thforis

Re: [AngularJS] Re: Something wrong or just me?

2016-08-12 Thread 'Lucas Lacroix' via AngularJS
Hi Dave, Google is your friend: https://angular.io/docs/ts/latest/guide/webpack.html On Fri, Aug 12, 2016, 22:17 Dave Abbott wrote: > Thanks for the advise, but how would I go about that? Is there a guide / > tutorial or some starting reference point to get me going? > > >

Re: [AngularJS] Something wrong or just me?

2016-08-12 Thread 'Lucas Lacroix' via AngularJS
You should use WebPack or SystemJSBuilder to pack up your production files. On Fri, Aug 12, 2016, 18:45 Dave Abbott wrote: > > > I am trying to

Re: [AngularJS] Angular 2 with webpack Getting "Uncaught ReferenceError: System is not defined" following angular 2 webpack doc

2016-08-12 Thread 'Lucas Lacroix' via AngularJS
I have not had this issue and I am using WebPack with the latest RC. If the issue is occurring within your own modules, double check that your tsconfig.json file has "module": "commonjs". Otherwise, some external module must not have the correct variation for the WebPack loader. Not sure what you

Re: [AngularJS] Calling an parts of an angular app from another

2016-08-12 Thread 'Lucas Lacroix' via AngularJS
If your app's code exists in the same location, you can share components between the pages without issue, even when using WebPack or other bundling software. An alternative to that is to publish the shared components in NPM and install them in each appliction - this is the route we are currently

Re: [AngularJS] Re: Can't bind to 'ngModel' since it isn't a known property of 'input'

2016-08-10 Thread 'Lucas Lacroix' via AngularJS
​I believe you're missing the directive for NgModel on your component.​ On Wed, Aug 10, 2016 at 2:41 PM, Eduardo Cavalcanti < eduardo.m.cavalca...@uol.com.br> wrote: > This is the error message: > > "Template parse errors: Can't bind to 'ngModel' since it isn't a known > property of 'input'. ("

Re: [AngularJS] browser_adapter.js:84 ORIGINAL EXCEPTION: TypeError: iterator1.next is not a function - after updating to Chrome Version 52.0.2743.116 (64-bit)

2016-08-08 Thread 'Lucas Lacroix' via AngularJS
It looks to me like you're running the code in a browser that doesn't support ES6 iterators and you are missing the shim/polyfill. On Mon, Aug 8, 2016 at 11:46 AM, Darragh Flynn wrote: > I get a the following error message when trying run my Ionic/Angular 2 app > in the

Re: [AngularJS] Re: Limiting the Decimal to 2 digits

2016-08-08 Thread 'Lucas Lacroix' via AngularJS
You could extend the pipe and make you're own. This is probably the best way to get the exact format you want. On Mon, Aug 8, 2016 at 9:30 AM, Ciprian Serbu wrote: > actually chaining won't work if the number is greater or equal to 1000 as > the first filter will add

Re: [AngularJS] [Angular2] const Objects, e.g. Hero.DR_EVIL

2016-08-06 Thread 'Lucas Lacroix' via AngularJS
Look at Object.freeze, which is part of es6. Just keep in mind that this won't work and can't be polyfilled on older browsers. On Sat, Aug 6, 2016, 15:27 wrote: > Hello Lucas! > > Yes, I've missed to import the constant... > > import { Hero, DR_EVIL } from

Re: [AngularJS] Angular 2 equivalent of Angular 1's angular.isArray, angular.isDefined, etc. ?

2016-08-06 Thread 'Lucas Lacroix' via AngularJS
These are already part of Javascript. Array.isArray(x) - static method of the array class object.hasOwnProperty('name') - member function of all classes On Sat, Aug 6, 2016, 11:45 Fred Morrison wrote: > What is the Angular 2 equivalent of Angular 1's built-in

Re: [AngularJS] [Angular2] const Objects, e.g. Hero.DR_EVIL

2016-08-05 Thread 'Lucas Lacroix' via AngularJS
​My guess would be that the constant has not been imported where you are using it. Where are you trying to use the constant? In a template, maybe? One ​other thing, unrelated to your issue, is you have defined Hero as a class but you initialize the constant as a generic object. You should add a

Re: [AngularJS] Two way binding is not working for input type in Angular 2 with IE 9

2016-08-04 Thread 'Lucas Lacroix' via AngularJS
Could you reproduce in a plunkr? On Thu, Aug 4, 2016, 19:53 rajesh patel wrote: > Hi, we are using Angular 2 and we need to support IE 9 for our customer > My pages are working fine in Chrome and Firefox but with IE 9 two way > binding is not working > whatever I change in

Re: [AngularJS] @NgModule

2016-08-04 Thread 'Lucas Lacroix' via AngularJS
I can only answer your JIT question. JIT is suggested (maybe even necessary) when developing using a server that implements a live-reload mechanism as it significantly shortens the time developers need to wait for the application to show the changes they have made. JIT should never be used in

Re: [AngularJS] AngularJS 2 - Debug in Chrome

2016-08-02 Thread 'Lucas Lacroix' via AngularJS
I think you want to do something like this: return new Observable((observer: Observer) => { this.http.post(...) .map(res => res.json()) .do((data) => { ... all that code in the callback goes here ... }) .map((data) => data.token)

Re: [AngularJS] AngularJS 2 - Debug in Chrome

2016-08-02 Thread 'Lucas Lacroix' via AngularJS
That is absolutely correct. The code at line 32 is a callback that is invoked asynchronously. Line 44 will always be hit first. On Tue, Aug 2, 2016 at 11:42 AM, Rafael Gouveia da silva < desenvolvedorraf...@gmail.com> wrote: > >

Re: [AngularJS] Re: ng2: iterate over object and display its keys...

2016-08-01 Thread 'Lucas Lacroix' via AngularJS
Could you put an example on plunkr? Even if it doesn't work, it will better explain what it is you are trying to do. On Mon, Aug 1, 2016, 21:36 p. stephen w wrote: > Anyone? > Is the question unclear? > > > > On Sunday, July 31, 2016 at 7:33:53 AM UTC-7, p. stephen w

Re: [AngularJS] Angular 2 Http with promise issue

2016-07-31 Thread 'Lucas Lacroix' via AngularJS
You're callback does not include the console statement. It should be something like this: .then(user => { // all code that is waiting for the response goes here }) On Sun, Jul 31, 2016, 13:53 wrote: > i am try to create a login app using angular 2 http with promise. > >

Re: [AngularJS] Angular JWT => set header

2016-07-31 Thread 'Lucas Lacroix' via AngularJS
That header needs to be set by the server you're attempting to get the resource from. It's not something you set in the request. Basically, your browser does sends HTTP OPTIONS request to the server is expects it to return this header. This is what it means when it says "preflight request". Most

Re: [AngularJS] ng2: iterate over object and display its keys...

2016-07-30 Thread 'Lucas Lacroix' via AngularJS
Use a function that returns Object.keys to enumerate the keys. That's what I've done. On Sat, Jul 30, 2016, 10:14 p. stephen w wrote: > ngFor only works on arrays and iterables - github-angular-issues >

Re: [AngularJS] Angular 2: XMLHttpRequest cannot load

2016-07-29 Thread 'Lucas Lacroix' via AngularJS
Is the page being served from the same port and host? This error seems to say that the server doesn't support CORS and you tried to request a resource from a different server. Note: in order for CORS to not be in effect, your request must match the protocol, hostname, and port of the page making

Re: [AngularJS] xml to json with observable

2016-07-29 Thread 'Lucas Lacroix' via AngularJS
The console.log is executed before the asynchronous operation (ie. ".subscribe") invokes the callbacks. On Fri, Jul 29, 2016 at 11:18 AM, Josh Restivo wrote: > I've tried various incarnations of the following function and can't get > 'this.entries' to return with any

Re: [AngularJS] Angular/2 Component Router : Capture query parameters

2016-07-28 Thread 'Lucas Lacroix' via AngularJS
Sorry... Hit send too soon. Try having your Oauth redirect Uri include the "#/". On Thu, Jul 28, 2016, 11:28 Lucas Lacroix wrote: > It looks like this might be a consequence of using the hash location > strategy. > > On Thu, Jul 28, 2016, 11:16 'Charles Jackson' via

Re: [AngularJS] Angular/2 Component Router : Capture query parameters

2016-07-28 Thread 'Lucas Lacroix' via AngularJS
It looks like this might be a consequence of using the hash location strategy. On Thu, Jul 28, 2016, 11:16 'Charles Jackson' via AngularJS < angular@googlegroups.com> wrote: > Hi, > > I'm struggling with the new component router. I'm using the oAuth API on > twitter which redirects back to my

Re: [AngularJS] Rxjs filter operator not working with Angular2 Observable

2016-07-27 Thread 'Lucas Lacroix' via AngularJS
It looks like x is an array, not an object. So... I think you need to: .map(x => { return x.filter(y => y.type === 'member'); }) On Wed, Jul 27, 2016 at 4:26 PM, T wrote: > up vote0down votefavorite >

Re: [AngularJS] Re: ng-pattern not working

2016-07-26 Thread 'Lucas Lacroix' via AngularJS
In Angular2, there is a PatternValidator directive. Not sure if there is an equivalent directive for Angular1. Sorry I can't be of more help. On Tue, Jul 26, 2016 at 12:45 PM, Rajan Singh wrote: > I have already verified regex on http://regexr.com/ & now verified on >

Re: [AngularJS] ng-pattern not working

2016-07-26 Thread 'Lucas Lacroix' via AngularJS
This seems like an issue with regex. I would try out a service like this: https://regex101.com/ On Tue, Jul 26, 2016 at 10:54 AM, Rajan Singh wrote: > Hi, > > I have pattern which is /^\w(?:(?![ \\.']{2,})[\w \\.'])*/. It is for > name which starts with words &

Re: [AngularJS] Re: Clear Documentation for angular2 for plain javascript / es5

2016-07-26 Thread 'Lucas Lacroix' via AngularJS
The core-js library should provide all the polyfills you need. I would suggest creating a plunkr to reproduce the issue. Otherwise, there is nothing else to go on here. I don't write Javascript anymore. Typescript (or any other transpiler) has far too many benefits to write vanilla JS, IMO.

Re: [AngularJS] Re: Clear Documentation for angular2 for plain javascript / es5

2016-07-26 Thread 'Lucas Lacroix' via AngularJS
It sounds like you're missing a polyfill or library. What scripts are you pulling in? On Tue, Jul 26, 2016 at 2:08 AM, Venkata Chakradhar < venkatachakrad...@gmail.com> wrote: > > I loaded this file > "~/.bin/node_modules/@angular/router/bundles/router.umd.js", which covers > routing and

Re: [AngularJS] 404: '@angular/src' is not in the npm registry?

2016-07-25 Thread 'Lucas Lacroix' via AngularJS
That is the beta and is before angular2 was modularized. If you're using one of the RCs (hopefully, the latest), then you need to pull in each module as needed. On Mon, Jul 25, 2016 at 1:44 PM, Randy Gamage wrote: > I have noticed some Visual Studio example projects reference

Re: [AngularJS] how to reload/refresh the component view forcefully?

2016-07-25 Thread 'Lucas Lacroix' via AngularJS
Try to reproduce the issue on plunkr. If you can, link the plunkr here. On Mon, Jul 25, 2016, 12:03 Navaneetha Krishnan S wrote: > Luke, > I tried with this, still it is not working. any other ideas? > I tried writing the changes object values into the console.log - I can

Re: [AngularJS] how to reload/refresh the component view forcefully?

2016-07-25 Thread 'Lucas Lacroix' via AngularJS
Change the values of the sampleData object instead of swapping out the sampleData object: public LoadExtractorQueueDetails() { console.log("in LoadExtractorQueueDetails of ExtractorQueueDetails"); this.sampleData.queueId = 456; this.sampleData.name = "Krishnan123" ;

Re: [AngularJS] general architectural name for angular services?

2016-07-25 Thread 'Lucas Lacroix' via AngularJS
IMO, just call it a "Service". The fact that the service uses another down-stream service is not something that caller need worry about. The caller should not need to worry about the implementation details of the service and making the name specific to the implementation means that it would be

Re: [AngularJS] Insert plain HTML into template

2016-07-25 Thread 'Lucas Lacroix' via AngularJS
This should work: On Mon, Jul 25, 2016 at 11:00 AM, Alex Lavrik wrote: > I need to insert plain HTML which I receive from $http.get() into my > template as HTML tags like jQuery inserts plain HTML into DOM as tags. > > Conroller code: > var onLoadUrl = function( data ){

Re: [AngularJS] Clear Documentation for angular2 for plain javascript / es5

2016-07-25 Thread 'Lucas Lacroix' via AngularJS
Did you load/import the appropriate package that contains the Router classes? In other words:

Re: [AngularJS] Issues in binding dynamic json to input controls

2016-07-25 Thread 'Lucas Lacroix' via AngularJS
If you are replacing the value of resultData, the input has no way to detect that because it is bound to the old object's queueId member which has NOT changed. The control does not bind to the component's resultData member. My suggestion is to either A) apply the updates to the resultData object

Re: [AngularJS] Re: Property 'toPromise' does not exist on type 'Observable'. any

2016-07-25 Thread 'Lucas Lacroix' via AngularJS
PS - you should NOT import 'rxjs/Rx' as your application will be bloated. On Mon, Jul 25, 2016 at 9:24 AM, Lucas Lacroix wrote: > Sorry... Missed the part where you're already doing that. > > Try trapping out the Observable class (this works in Chrome, and maybe >

Re: [AngularJS] Re: Property 'toPromise' does not exist on type 'Observable'. any

2016-07-25 Thread 'Lucas Lacroix' via AngularJS
Sorry... Missed the part where you're already doing that. Try trapping out the Observable class (this works in Chrome, and maybe Firefox): console.log('%O', Observable); -Luke On Mon, Jul 25, 2016 at 9:22 AM, Lucas Lacroix wrote: > If you are not importing 'rxjs/all',

Re: [AngularJS] Re: Property 'toPromise' does not exist on type 'Observable'. any

2016-07-25 Thread 'Lucas Lacroix' via AngularJS
If you are not importing 'rxjs/all', then the Rxjs package is modularized and you need to "add in" each function you want. I suggest you do NOT import the 'all' module as this will bloat your application significantly. Example: import {Observable} from 'rxjs/Observable'; import

Re: [AngularJS] 404: '@angular/src' is not in the npm registry?

2016-07-22 Thread 'Lucas Lacroix' via AngularJS
That is not an angular module that I am aware of. If you've followed the Angular2 tutorial , you should have these dependencies in your package.json: @angular/common @angular/compiler @angular/core @angular/forms @angular/http @angular/platform-browser

Re: [AngularJS] Ordering Imports

2016-07-22 Thread 'Lucas Lacroix' via AngularJS
This section says it all: https://angular.io/docs/ts/latest/guide/style-guide.html#!#03-06 Order your import statements alphabetically by module name. So, your 'import ... "./heroes";' line should come after your 'import ... "./equipment";' line. Order the destructured imported assets within

Re: [AngularJS] cannot find module '@angular/core'?

2016-07-22 Thread 'Lucas Lacroix' via AngularJS
I think "angular2" is the old beta/alpha. All the angular2 modules are in the @angular scope and need to be installed individually. I think this happened when rc0 was released. npm i @angular/core --save npm i @angular/http --save There is no longer one large angular2 package. On Fri, Jul 22,

Re: [AngularJS] Dependency Injection question

2016-07-21 Thread 'Lucas Lacroix' via AngularJS
One way is by using a provider factory: bootstrap(MainComponent,[ > provide(MySecondApi,{ > useFactory: (http: Http) => { > return new MySecondApi(http, 'base path'); > }, > deps: [Http] > }) > ]); You could also pass that 'provide' invocation to the

Re: [AngularJS] Ordering Imports

2016-07-21 Thread 'Lucas Lacroix' via AngularJS
I do not believe there are any best practices - Google turns up nothing and if it's not in Google, it doesn't exist (a little humor there). The ordering of the imports has no effect on the application and, IMO, it does not increase readability/understanding when you enforce an arbitrary sort on

Re: [AngularJS] Ordering Imports

2016-07-21 Thread 'Lucas Lacroix' via AngularJS
You can order the imports in any way you want. On Thu, Jul 21, 2016 at 6:02 AM, Supun Budhajeewa wrote: > I used to order C#'s "using"s and PHP's "use"s in the alphabetical order. > > It worked well because one "use/using" statement imported one class or > namespace. > >

Re: [AngularJS] How get id value from array and save using $hhtp in a controller ?

2016-07-21 Thread 'Lucas Lacroix' via AngularJS
What do you mean "save"? Could you give some example code of what you are trying to do? On Thu, Jul 21, 2016 at 9:14 AM, Marcelo Rodrigues Castelo Branco < marcelorcastelobra...@gmail.com> wrote: > Hello! I have the following question : How do I save the value of an id that > is in this array [

Re: [AngularJS] Angular CLI Scripting Recommendation

2016-07-19 Thread 'Lucas Lacroix' via AngularJS
Most of what we were scripting could be done without emulating the shell capabilities of Bash, so we did not use shelljs. We merely used the Child Process module to invoke individual command lines. Example: > ​import * as ChildProcess from

Re: [AngularJS] Angular CLI Scripting Recommendation

2016-07-19 Thread 'Lucas Lacroix' via AngularJS
Why not use node? That is what we've switched over to. On Tue, Jul 19, 2016 at 1:52 PM, Ed Sinek wrote: > I'm playing around with Angular CLI (on Windows 7) and want to create a > script to generate the app, several components, routes, etc. Since I'm in > Windows, the low

Re: [AngularJS] Re: Initialise form from asynchronous observable

2016-07-19 Thread 'Lucas Lacroix' via AngularJS
There is also an async pipe available that allows you to pipe in an observable: https://angular.io/docs/ts/latest/guide/pipes.html Not sure if it's applicable to your example. On Tue, Jul 19, 2016 at 11:19 AM, Michael Battcock wrote: > Hi Sander, > > Thanks for the tip!

Re: [AngularJS] Re: ng2: ngIf on object keys, undefined error...

2016-07-19 Thread 'Lucas Lacroix' via AngularJS
If "myA.myB" is undefined or null, then "myA.myB[subscript]" will throw an exception. This is simple Javascript programming and not anything to do with Angular. Although Angular *could* cover the possibility of referencing undefined variables or members in bound logic, doing so could hide bad

Re: [AngularJS] Re: ng2: ngIf on object keys, undefined error...

2016-07-19 Thread 'Lucas Lacroix' via AngularJS
This is not Angular. This is just Javascript and you cannot get the member (or subscript) of something that is null or undefined. On Tue, Jul 19, 2016 at 8:42 AM, p. stephen w wrote: > Ah, that does work, even on a deeper object: > *ngIf="myA.myB &&

Re: [AngularJS] ng2: ngIf on object keys, undefined error...

2016-07-17 Thread 'Lucas Lacroix' via AngularJS
Next question: why are you using the square bracket notation? Why not: myObj.mykey? Also Are you sure you've initialized myObj? On Sun, Jul 17, 2016, 15:10 p. stephen w wrote: > Its defined on the component. > > works as expected. > woot > > > On Sunday, July 17,

Re: [AngularJS] ng2: ngIf on object keys, undefined error...

2016-07-17 Thread 'Lucas Lacroix' via AngularJS
Where is "myObj" defined? On Sun, Jul 17, 2016, 14:17 p. stephen w wrote: > This line produces an error on 'myObj': >Cannot read property 'mykey' of undefined. > woot > > It sounds like NG2 will not iterate over objects, and the

Re: [AngularJS] Provide router as promise

2016-07-14 Thread 'Lucas Lacroix' via AngularJS
Put the call to boostrap inside the promise: routeConfig.then((conf) => { bootstrap(AppComponent,[ provideRouter(conf) ]); }); On Thu, Jul 14, 2016 at 9:38 AM, 'breaddes' via AngularJS < angular@googlegroups.com> wrote: > This is how I provide the router settings for my

Re: [AngularJS] Delay on input (keyup) in order to request server

2016-07-14 Thread 'Lucas Lacroix' via AngularJS
Right... Because you're not scoping correctly. Within a function, even a IIFE, the 'this' pointer is different from the enclosing scope. Example: class TestClass { someFunc() { // 'this' references an instance of TestClass, so this will work: this.otherFunc();

Re: [AngularJS] Delay on input (keyup) in order to request server

2016-07-14 Thread 'Lucas Lacroix' via AngularJS
Then use the standard Javascript setTimeout function. On Thu, Jul 14, 2016 at 6:27 AM, Simon Azzopardi < simon.azzopa...@casasoft.com.mt> wrote: > Hi Lucas, > > I need to store the string in another value to be passed to ag-grid. > > All I want just to timeout the keyup... > > On Thursday, July

Re: [AngularJS] Delay on input (keyup) in order to request server

2016-07-14 Thread 'Lucas Lacroix' via AngularJS
Take a look at ng2-bootstrap. It already has a typeahead component which should do what you want: http://valor-software.com/ng2-bootstrap/#/typeahead On Thu, Jul 14, 2016 at 6:05 AM, Simon Azzopardi < simon.azzopa...@casasoft.com.mt> wrote: > Hi guys, > > Does anyone can give some help on how to

Re: [AngularJS] Unable to start npm

2016-07-13 Thread 'Lucas Lacroix' via AngularJS
The package.json looks correct. The exit status indicates that it cannot find the command. As I do not see the output from tsc, I would guess that it is the command that is missing. Try running "npm i" and then try "npm start" again from your project root. On Wed, Jul 13, 2016 at 1:05 PM, Dawg

Re: [AngularJS] Unable to start npm

2016-07-13 Thread 'Lucas Lacroix' via AngularJS
It looks like you already have a web-server running (you're in the xampp folder, after all). My guess is that lite-server fails to start. Try removing that from the start script in your package.json. If that doesn't work (or you are confused), attach your package.json to your reply. On Wed, Jul

Re: [AngularJS] Own mapping like '@angular' = 'node_modules/@angular',

2016-07-13 Thread 'Lucas Lacroix' via AngularJS
I would not suggest this specifically for the reason that you will not be able to package up your application using WebPack or SystemJS builder, meaning that your application, if it has a lot of modules/resources, could be VERY slow to load, especially so if a device has a fairly limited cache

Re: [AngularJS] Unable to start npm

2016-07-13 Thread 'Lucas Lacroix' via AngularJS
Actually... Lite-server should choose a random port... Please send over your package.json. On Wed, Jul 13, 2016 at 12:58 PM, Lucas Lacroix wrote: > It looks like you already have a web-server running (you're in the xampp > folder, after all). My guess is that lite-server

Re: [AngularJS] Own mapping like '@angular' = 'node_modules/@angular',

2016-07-13 Thread 'Lucas Lacroix' via AngularJS
I'm not sure I understand your use case. It seems like you want to use one URL for '@angular/core' if a parameter has a particular value and a different URL if it has another. Is that what you're trying to do? On Wed, Jul 13, 2016 at 11:49 AM, Lucas Lacroix wrote: > No.

Re: [AngularJS] Own mapping like '@angular' = 'node_modules/@angular',

2016-07-13 Thread 'Lucas Lacroix' via AngularJS
No. Typescript knows nothing about scopes. It merely searches in node_modules for a FOLDER '@angular/core' (or whatever package you're referencing). There is nothing special Typescript needs to do. On Wed, Jul 13, 2016 at 11:47 AM, 'breaddes' via AngularJS < angular@googlegroups.com> wrote: >

Re: [AngularJS] Re: Angular2 cannot find element

2016-07-11 Thread 'Lucas Lacroix' via AngularJS
I updated to rc4 from rc1. The error is now: "Error during instantiation of AnimationDriver!" which, conveniently, had results in Google. The issue is as I thought: bootstrap does not wait for the onload event. I have changed my code to do this: window.addEventListener('load',(evt)=>

Re: [AngularJS] Re: Angular2 cannot find element

2016-07-10 Thread 'Lucas Lacroix' via AngularJS
The example really is this simple and it us not a problem with imports. In order for bootstrap to get to the point where it is looking for the element in the DOM and throwing this error, all imports would have to be completed and all Javascript interpreted successfully. Otherwise, there would be

Re: [AngularJS] Re: Angular2 cannot find element

2016-07-09 Thread 'Lucas Lacroix' via AngularJS
It is the entire example except the CSS and HTML of the component have been excluded for brevity. They are inconsequential as the code isn't even getting as far as processing it - we are still bootstrapping which means we haven't even instantiated any components yet and the manipulation of the

Re: [AngularJS] Re: Angular2 cannot find element

2016-07-08 Thread 'Lucas Lacroix' via AngularJS
There are no syntax or network errors in the console, so it is neither a syntax issue nor a typo in a file name. Even if that were the issue, the error indicates it can't find the 'login' element in index.html. The question is: how is bootstrap not finding the element when it clearly and

[AngularJS] Angular2 cannot find element

2016-07-08 Thread 'Lucas Lacroix' via AngularJS
I'm not sure what's going on here. This is my index.html: ... Initializing... The component passed into bootstrap is as follows: @Component({ selector: 'login', template: template, styles: [style.toString()], directives: [] }) export class Login { constructor() {

Re: [AngularJS] Sanitization warnings on color strings in Angular2

2016-07-08 Thread 'Lucas Lacroix' via AngularJS
You're better off using Angular2 style: On Fri, Jul 8, 2016 at 5:00 PM, 'Forrester Cole' via AngularJS < angular@googlegroups.com> wrote: > Hi all, >I'm trying to set the background-color style of an element using a > template. I have template html code that looks like: > > >

Re: [AngularJS] Re: Injecting without constructor

2016-07-08 Thread 'Lucas Lacroix' via AngularJS
my global service is from the constructor? Or i can > create a component with any constructor and on "OnInit" i set > "this.myService = ???". > > Thanks. > > > On Fri, Jul 8, 2016 at 2:00 PM, 'Lucas Lacroix' via AngularJS < > angular@googlegroups.c

Re: [AngularJS] Re: Injecting without constructor

2016-07-08 Thread 'Lucas Lacroix' via AngularJS
My understanding is that all injected dependencies are singletons. So, if you inject the same type of thing in multiple places, you should receive the single instance of that thing. On Fri, Jul 8, 2016 at 12:58 PM, Paulo Coutinho wrote: > Hi, > > I need a global service

Re: [AngularJS] Re: Can we see some sample code for passing FORM data to a server script?

2016-07-05 Thread 'Lucas Lacroix' via AngularJS
I have no sample code off-hand, but take a look at the Http class , which can be used as the basis for you to create a FormSubmit service for your API. You would use it very similar to how you would use $.ajax but instead of a

Re: [AngularJS] Getting error on loading in angular2 RC4: Error: XHR error (404 Not Found) loading

2016-07-05 Thread 'Lucas Lacroix' via AngularJS
Best guess: your node_modules folder in not accessible from your webserver. On Tue, Jul 5, 2016 at 3:15 PM, Navaneetha Krishnan S wrote: > I am getting the following exception when the application is loading on > the browser. Please find the config files and error

Re: [AngularJS] Angular 2: Can't resolve all parameters for NotificationsService: (?, ?).

2016-07-05 Thread 'Lucas Lacroix' via AngularJS
I think you're missing the FindService in your providers that are passed to bootstrap. I do not see it referenced. As long as a provider is specified for each injectable, this should work. On Tue, Jul 5, 2016 at 10:39 AM, HisDivineShadow < buddy.ackerman...@gmail.com> wrote: > So, after some

Re: [AngularJS] Angular 2: Can't resolve all parameters for NotificationsService: (?, ?).

2016-07-05 Thread 'Lucas Lacroix' via AngularJS
I do not see your component with it's list of providers nor do I see your bootstrap call with the list of providers. On Tue, Jul 5, 2016 at 10:04 AM, HisDivineShadow < buddy.ackerman...@gmail.com> wrote: > I get this error loading my app. I'm injecting the NotificationsService > into my app

Re: [AngularJS] ngKeyup, ngKeydown and ngKeypress

2016-07-05 Thread 'Lucas Lacroix' via AngularJS
I don't think this is an Angular issue. KeyUp and KeyDown events are different from KeyPress events. KeyUp/Down give you key codes while KeyPress gives you character codes - sometimes these are the same, sometimes they are not. The way in which the different browser have implemented the events

Re: [AngularJS] Re: AuthGuard CanActivate navigate to the previous url the user was in - Angular 2

2016-07-04 Thread 'Lucas Lacroix' via AngularJS
Yes. On Mon, Jul 4, 2016, 09:33 Simon Azzopardi wrote: > Hi Lucas, > > You mean I need to crop the url to get the last part of the url, example > clients? > > > On Monday, July 4, 2016 at 12:28:08 PM UTC+2, Lucas Lacroix wrote: > >> Like I said already: you will

Re: [AngularJS] Angular2 styleguide 03-04

2016-07-04 Thread 'Lucas Lacroix' via AngularJS
I usually prefix the private member with an underscore: class Example { private _member: string; get member() { return this._member; } set member(val: string) { this._member = val; } } On Mon, Jul 4, 2016 at 9:13 AM, Pim Kartner wrote:

Re: [AngularJS] Re: AuthGuard CanActivate navigate to the previous url the user was in - Angular 2

2016-07-04 Thread 'Lucas Lacroix' via AngularJS
Like I said already: you will need to adjust the URL to match your application. On Mon, Jul 4, 2016, 06:26 Simon Azzopardi wrote: > Hi Lucas, > > I have already tried that but it is not redirecting there. > > this._router.navigate([originalUrl]); > >

Re: [AngularJS] Re: AuthGuard CanActivate navigate to the previous url the user was in - Angular 2

2016-07-04 Thread 'Lucas Lacroix' via AngularJS
Open your browser debugging tools and play around with the location object. Between that and the documentation I already sent you, you should be able to figure it out. On Mon, Jul 4, 2016, 06:08 Simon Azzopardi wrote: > Hi Lucas, > > Thanks for that. > > I was

  1   2   >