Re: [AngularJS] Re: Angular 2 form validation with input type=“text” with some condition

2016-12-15 Thread Sander Elias
Hi Aec,

If you build a plunk showcasing your issue, I will take a look at this. 
That was way too much code for pasting in a message. ;)

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: ng-html-bind causing $sanitize:badparse with special character '<'

2016-12-15 Thread Sander Elias
Hi Chaitanya,

$sce only detects invalid HTML, you need to provide a valid HTML document. 
If you want to sanitise your HTML, you need to do this before your feed it 
to $sce. 
You can use a library like XSS to do that. 
(there are a lot more of those, this one came up first in a google search!)

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: Angular 2 form validation with input type=“text” with some condition

2016-12-15 Thread reginemcfarlane via Angular


On Thu, 12/15/16, reginemcfarlane via Angular  wrote:

 Subject: Re: [AngularJS] Re: Angular 2 form validation with input type=“text” 
with some condition
 To: angular@googlegroups.com
 Date: Thursday, December 15, 2016, 11:01 PM
 
 
 
 On Thu, 12/15/16, abhishek chaturvedi 
 wrote:
 
  Subject: Re: [AngularJS] Re: Angular 2 form validation with
 input type=“text” with some condition
  To: angular@googlegroups.com
  Date: Thursday, December 15, 2016, 1:19 PM
  
  sharing u
  my html:
         
            
            
                
            
  Select
  All           
        
        
        
        
            
    
            
     Business
  Days       
            
 Calendar
  Days       
        
        
        
        
            
    
                
                
            
 
             
            
    
            
     
  Jan           
        
            
                
            
            
            
        
        
            
        
            
 
             
            
            
            
            
     
  Feb           
        
            
                
            
                
            
        
            
        
            
     
             
            
            
            
            
     
  Mar           
        
            
                
            
                
            
        
            
        
            
            
        
        
         
             
            
            
    
            
            
            
     
  Apr           
        
            
                
            
                
            
        
            
        
            
     
             
            
            
            
            
     
  May           
        
            
                
            
                
            
        
            
        
            
     
             
            
            
            
            
     
  Jun           
        
            
                
            
                
            
        
            
        
            
     
             
        
            
 
             
            
            
    
            
            
            
     
  Jul           
        
            
                
            
                
            
        
            
        
            
     
             
            
            
            
            
     
  Aug           
        
            
                
            
                
            
        
            
        
            
     
             
            
            
            
            
     
  Sep           
        
            
                
            
                
            
        
            
        
            
            
        
        
         
             
            
            
    
            
            
            
     
  Oct           
        
            
                
            
                
            
        
            
        
            
     
             
            
            
            
            
     
  Nov           
        
            
                
            
                
            
        
            
        
            
     
             
            
            
            
            
     
  Dec           
        
            
                
            
                
            
        
            
        
            
            
        
        
                
        
                
    
     
  On Thu, Dec 15, 2016 at
  3:39 PM, abhishek chaturvedi 
  wrote:
  I made a model-driven form in angular 2, and
  one of the input fields (it's basically a month let jan)
  must show up only if a dropdown above is selected
 particular
  which basically a . My question is how can I
  set that input required only if the option value is
  Calendar? And also i want that max value cann't greater
  than 31 as it's month field.
  
  Business
  DaysCalendar
  Days
  
  
  On Thu, Dec 15, 2016 at
  2:48 PM, Sander Elias 
  wrote:
  Hi Aec,
  You mean
  something like:
  
    Number
    
  
  
  ??
  RegardsSander
  
  
  
  -- 
  
  You received this message because you are subscribed to a
  topic in the Google Groups "Angular" group.
  
  To unsubscribe from this topic, visit https://groups.google.com/d/to
  pic/angular/aXposLnawjE/unsubs cribe.
  
  To unsubscribe from this group and all its topics, send an
  email to angular+unsubscribe@googlegrou
  ps.com.
  
  To post to this group, send email to angular@googlegroups.com.
  
  Visit this group at https://groups.google.com/grou
  p/angular.
  
 

[AngularJS] Re: Angular 2 multiple HTTP, best practice

2016-12-15 Thread Dawg
Hi Sander,

thanks for the info. your post helped. the tutorials i been using all use 
subscribe and i thought it was a necessary function to work with post/get. 
not quite sure what async pipe does as but will look it up.. the subject of 
observable seems to be a challenging topic to catch..

again thanks. 

On Thursday, December 15, 2016 at 12:35:55 PM UTC-5, Sander Elias wrote:
>
> No, you move it to the template by utilising the async pipe. there is no 
> subscribe in your code at all anymore.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] hosting of angular 2 on heroku

2016-12-15 Thread Pedro Cova
Locally the application runs without problems but when I upload it to 
heroku I get the following error in the browser console.

Error: (SystemJS) Unexpected token <
SyntaxError: Unexpected token <
at eval ()
Evaluating http://tc-bienes-back.herokuapp.com/app/main.js
Error loading http://tc-bienes-back.herokuapp.com/app/main.js
at eval ()
Evaluating http://tc-bienes-back.herokuapp.com/app/main.js
Error loading http://tc-bienes-back.herokuapp.com/app/main.js


my app/main.js

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app.module';

platformBrowserDynamic().bootstrapModule(AppModule);


my systemjs.config.js

/**
 * System configuration for Angular samples
 * Adjust as necessary for your application needs.
 */
(function (global) {
  System.config({
paths: {
  // paths serve as alias
  'npm:': '../node_modules/',
},
// map tells the System loader where to look for things
map: {
  // our app is within the app folder
  app: 'app',

  // angular bundles
  '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
  '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
  '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
  '@angular/platform-browser': 
'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
  '@angular/platform-browser-dynamic': 
'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js'
,
  '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
  '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
  '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
  '@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',

  // other libraries
  'moment': 'npm:moment/moment.js',
  'ng2-bootstrap/ng2-bootstrap': 
'npm:ng2-bootstrap/bundles/ng2-bootstrap.umd.js',
  'angular2-jwt': 'npm:angular2-jwt/angular2-jwt.js',
  'rxjs':  'npm:rxjs',
  'angular-in-memory-web-api': 'npm:angular-in-memory-web-api',
},
// packages tells the System loader how to load when no filename and/or 
no extension
packages: {
  app: {
main: './main.js',
defaultExtension: 'js'
  },
  rxjs: {
defaultExtension: 'js'
  },
  'angular-in-memory-web-api': {
main: './index.js',
defaultExtension: 'js'
  }
}
  });
})(this);

The error that gives me chrome usually happens because reasons?

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: Angular 2 form validation with input type=“text” with some condition

2016-12-15 Thread reginemcfarlane via Angular


On Thu, 12/15/16, abhishek chaturvedi  wrote:

 Subject: Re: [AngularJS] Re: Angular 2 form validation with input type=“text” 
with some condition
 To: angular@googlegroups.com
 Date: Thursday, December 15, 2016, 1:19 PM
 
 sharing u
 my html:
Select
 All  
  Business
 Days  Calendar
 Days   
  
   
 Jan
 
  
  
 Feb
  
  
  
 Mar
  


 Apr
  
  
  
 May
  
  
  
 Jun
  
  
  

 Jul
  
  
  
 Aug
  
  
  
 Sep
  


 Oct
  
  
  
 Nov

[AngularJS] Re: ng-html-bind causing $sanitize:badparse with special character '<'

2016-12-15 Thread Chaitanya
Hello Sander,

Greetings! 
Resurfacing a old thread - We are seeing this issue in our implementation 
now -
And i don't think we can replace < and > that's in the content (as along 
with the content, the bold  italic tags all have this < and > and 
when we replace those bold/italics will not happen instead  is printed 
on the screen)

In our case content is like this and the below * < * is creating 
$sanitize:badparse exception and empty string/content is being rendered on 
the screen 

content : "Test50 Welcome50Steps Taken To 
Resolve Auto approval for amount* < *100 dollars 
Additional Commentssample"

Can you please review and suggest a solution.

Thanks,
Chaitanya.


On Tuesday, 21 January 2014 12:57:10 UTC, Sander Elias wrote:
>
> Hi Patrick,
>
> Well, your sting is not HTML-'safe', and can not be parsed. If you need to 
> include < and > in a string you want parsed, you have to escape those. 
> There are a few other things that needs escaping too, but those are the 
> most important ones.
> you need to replave the < with  and the > with   
> For a more complete list go here 
> 
>
> Regards
> Sander
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Angular 2 - Validation from parent component to child

2016-12-15 Thread Jo bobber
Could someone offer some advice, is it possible to validate a child 
component.  The following code below works great with the following code.
What I can't seem to get working is for the parent component to fire the 
validation on the child.

Any help would be greatly appreciated.


// ***  Using this control on model driven form ***
//
// markup
//   
//
//  Create a model from control
//   this.form = new FormGroup({state: new FormControl('-1', 
Validators.required) }); 
//
// set the form control on selection
//   stateSelected($event) {  
this.form.controls['state'].setValue($event.selected);}
//
// * 



import { element } from 'protractor';
import { Component, OnInit, OnDestroy,  Input, Output, EventEmitter } from 
'@angular/core';
import { FormBuilder, FormGroup, FormControl, Validators }from 
'@angular/forms';

@Component({
selector: 'us_states',
template: `
State:

Select 

{{ w.State }}




 Warning! Please select a 
state!


`
})
export class StatesComponent implements OnInit { 

form: FormGroup;   
@Output() selected = new EventEmitter();
@Input() validate = false;
@Input() reset = false;

ngOnInit(): void {

}

ngOnDestroy() {
  this.selected.unsubscribe();
}

OnSelect(selected) {
this.selected.emit({selected: selected});
}

states =  [
{"State": "AL", "Name": "Alabama" },{"State": "AK", "Name": 
"Alaska"},
{"State": "AS", "Name": "American Samoa"}, {"State": "AZ", 
"Name": "Arizona"},
{"State": "AR", "Name": "Arkansas"},{"State": "AK", "Name": 
"Alaska"},
{"State": "CA", "Name": "California"},{"State": "CO","Name": 
"Colorado"},
{"State": "CT", "Name": "Connecticut"},{"State": "DE", "Name": 
"Delaware"},
{"State": "DC", "Name": "District Of Columbia"},{"State": "FM", 
"Name": "Federated States of Micronesia"},
{"State": "FL", "Name": "Florida"},{"State": "GA", "Name": 
"Georgia"},
{"State": "GU", "Name": "Guam"},{"State": "HI", "Name": 
"Hawaii"},
{"State": "ID", "Name": "Idaho"},{"State": "IL", "Name": 
"Illinois"},
{"State": "IN", "Name": "Indiana"},{"State": "IA", "Name": 
"Iowa"},
{"State": "KS", "Name": "Kansas"},{"State": "KY",  "Name": 
"Kentucky"},
{"State": "LA", "Name": "Louisiana"},{"State": "ME", "Name": 
"Maine"},
{"State": "MH", "Name": "Marshall Islands"},{"State": "MD", 
"Name": "Maryland"},
{"State": "MA", "Name": "Massachusetts"},{"State": "MI", 
"Name": "Michigan" },
{"State": "MN", "Name": "Minnesota"},{"State": "MS", "Name": 
"Mississippi"},
{"State": "MO", "Name": "Missouri"},{"State": "MT", "Name": 
"Montana"},
{"State": "NE", "Name": "Nebraska"},{"State": "NV", "Name": 
"Nevada"},
{"State": "NH", "Name": "New Hampshire"},{"State": "NJ", 
"Name": "New Jersey"},
{"State": "NM", "Name": "New Mexico"},{"State": "NY", "Name": 
"New York"},
{"State": "NC", "Name": "North Carolina"},{"State": "ND", 
"Name": "North Dakota"},
{"State": "MP", "Name": "Northern Mariana Islands"},{"State": 
"OH", "Name": "Ohio"},
{"State": "OK", "Name": "Oklahoma"},{"State": "OR", "Name": 
"Oregon"},
{"State": "PW", "Name": "Palau"},{"State": "PA", "Name": 
"Pennsylvania"},
{"State": "PR", "Name": "Puerto Rico"},{"State": "RI", "Name": 
"Rhode Island"},
{"State": "SC", "Name": "South Carolina"},{ "State": "SD", 
"Name": "South Dakota"},
{"State": "TN", "Name": "Tennessee"},{"State": "TX", "Name": 
"Texas"},
{"State": "UT", "Name": "Utah"},{"State": "VT", "Name": 
"Vermont"},
{"State": "VI", "Name": "Virgin Islands"},{"State": "VA", 
"Name": "Virginia"},
{"State": "WA", "Name": "Washington"},{"State": "WV", "Name": 
"West Virginia"},
{"State": "WI", "Name": "Wisconsin"},{"State": "WY", "Name": 
"Wyoming"}
 ]  



}

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Angular 1.4 Custom Validation Using Directive Problems

2016-12-15 Thread James Niesen
Hi,

I'm trying to create a directive that does some validation and displays a 
custom error message.  I'm using boostrap.angular.validation, so supposedly 
I just have to do something with the $validator.  Below is my directive.  
If year is not found, I want to highlight the DateCompletedCSA field and 
display a custom error.  I've searched all over for doc on how to find 
this, but have ran into a wall:

WellnessReimbursementsApp.directive('dateValidator', function () {

return {

restrict: 'A',

require: 'ngModel',

link: function (scope, element, attrs, controller) {


element.on('mouseout', function (event) { 

if (scope.member.request.DateCompleted != null) {

// 2. Check the year against the allowed reimbursement years:

//var dateCompletedYear = scope.member.request.DateCompleted.getFullYear();

console.log(scope.member.request.DateCompleted);

var dateCompletedYear = '2012';

var foundValidYear = false;

$.each(scope.member.AllowedReimbursementYears, function (index, value) {

if (dateCompletedYear == value) {

foundValidYear = true;

console.log("found valid year");

return;

}

});

if (!foundValidYear) {

// can get it to alert, just not sure how to show custom message and flag 
correctly

//alert('bad year ' + dateCompletedYear);

// element.parent.find('.bs-invalid-msg').html(dateCompletedYear + ' year 
not allowed.');

//element.parent.find('.bs-invalid-msg').show();

//controller.$setValidity('DateCompletedCSA', false);

// controller.$validators.date = false;

//controller

//scope.$digest();

//scope.WellnessReimbursmentForm.DateCompletedCSA.$showValidation();

controller.$parsers.unshift(function (value) {

});

}

}

});

}

}

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Route between angular 1 and 2

2016-12-15 Thread john sam
Thanks. Will check. Can we route between 1 and 2 pages ? Is it possible ?

On Thursday, November 17, 2016 at 1:07:37 AM UTC-8, Alexander Golovan wrote:
>
> Check that: https://github.com/agolovan/AlexPhoneApp. I am using Angular 
> 1.5 routing and just Angular 2 components that are using url to go to 
> Angular 1.5 components. 
>
> On Wednesday, November 16, 2016 at 2:46:31 PM UTC-8, john sam wrote:
>>
>> Has anyone implemented angular 1 and 2 hybrid application ? If yes, how 
>> does the routing work ? any thoughts?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Angular 2 multiple HTTP, best practice

2016-12-15 Thread Sander Elias
No, you move it to the template by utilising the async pipe. there is no 
subscribe in your code at all anymore.

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: Angular 2 form validation with input type=“text” with some condition

2016-12-15 Thread abhishek chaturvedi
sharing u my html:






 Select All




Business Days
Calendar Days











 Jan









 Feb









 Mar












 Apr









 May









 Jun













 Jul









 Aug









 Sep












 Oct









 Nov









 Dec
















On Thu, Dec 15, 2016 at 3:39 PM, abhishek chaturvedi <
abhishek.chaturv...@gmail.com> wrote:

> I made a model-driven form in angular 2, and one of the input fields (it's
> basically a month let jan) must show up only if a dropdown above is
> selected particular which basically a . My question is how can I
> set that input required only if the option value is Calendar? And also i
> want that max value cann't greater than 31 as it's month field.
>
>
> Business Days
> Calendar Days
>
> [image: Inline image 1]
>
> On Thu, Dec 15, 2016 at 2:48 PM, Sander Elias 
> wrote:
>
>> Hi Aec,
>>
>> You mean something like:
>> 
>>   Number
>>   
>> 
>>
>>
>> ??
>>
>> Regards
>> Sander
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Angular" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/angular/aXposLnawjE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> angular+unsubscr...@googlegroups.com.
>> To post to this group, send email to angular@googlegroups.com.
>> Visit this group at https://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: Angular 2 form validation with input type=“text” with some condition

2016-12-15 Thread abhishek chaturvedi
I made a model-driven form in angular 2, and one of the input fields (it's
basically a month let jan) must show up only if a dropdown above is
selected particular which basically a . My question is how can I
set that input required only if the option value is Calendar? And also i
want that max value cann't greater than 31 as it's month field.


Business Days
Calendar Days

[image: Inline image 1]

On Thu, Dec 15, 2016 at 2:48 PM, Sander Elias  wrote:

> Hi Aec,
>
> You mean something like:
> 
>   Number
>   
> 
>
>
> ??
>
> Regards
> Sander
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Angular" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/angular/aXposLnawjE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> angular+unsubscr...@googlegroups.com.
> To post to this group, send email to angular@googlegroups.com.
> Visit this group at https://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Angular 2 form validation with input type=“text” with some condition

2016-12-15 Thread Sander Elias
Hi Aec,

You mean something like:

  Number
  



??

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.