haddydiane | 17 Feb 16:56 2015
Picon

drop down box 1 (departments) and drop down box 2 (titles) I cannot get drop down box 2 to populate with changed list of titles from user's selection from drop down box 1 inside a modal panel

Hello:

I am pretty new to angular js.  Here is the issue:    I display a model panel with 2 drop down boxes.  Box 1 is a list of departments and Box 2 is list of titles for that department.  When user changes a value in Box 1 I do a $scope.watch on that value and am able to retrieve the correct list of titles for department however the new list of values will not populate into drop box 2 inside the modal panel.  I have included some snippets of code for your review.

  html code:
                                       <tr>
                                          <td align="right" style="padding-bottom:8px;">Department:&nbsp;&nbsp;</td>
                                          <td style="padding-bottom:8px;">
                                              <select name="deptName"    ng-model="department.displayKey" ng-options="d.displayKey as d.dptDesc for d in departments">
                                                <option value ="">Select</option>
                                            </select>&nbsp;&nbsp;<span ng-show="deptAsterisk == true" style="font-weight:bold; color:red;">**</span>
                                          </td>
                                      </tr>

                                      <tr>
                                          <td align="right" style="padding-bottom:8px;">Badge Title:&nbsp;&nbsp;</td>
                                          <td style="padding-bottom:8px;">
                                                <select name="jobTitle" ng-model="title.displayKey" ng-options="t.displayKey as t.displayDesc for t in titles">
                                                <option value ="">Select</option>
                                            </select>&nbsp;&nbsp;<span ng-show="titleAsterisk == true" style="font-weight:bold; color:red;">**</span>
                                          </td>





Parent scope:

 IdbadgeManager.findTitlesForDepartment($scope.department.dptKey, function(titles)
                                 {
                                    $scope.titles = titles;
   
                                     (more code here)
      //the call to the modal panel

var    modalInstance = $modal.open({
                                                templateUrl: '/uihchr/ermaapps/idbadge/editIdbadgeModalPanel.html?unique=' + unique,
                                                scope: $scope,
                                                controller: editIdbadgeModalPanelCtrl,
                                                resolve: { titles : function() {return titles;}



 
  controller for modal panel

$scope.$watch('department.displayKey', function(newValue, oldValue)       
    {
       
        //as the dept changes we need to update to the correct title list
        if(newValue != oldValue)
        {
            IdbadgeManager.findTitlesForDepartment(newValue, function(data)
            {
              
                $scope.titles = [];
                $scope.titles = data;
              
             
                   

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Sujata Dwivedi | 17 Feb 13:48 2015
Picon

Protractor:How to remove extra space from string just like we use in java getText.trim()

Hi All,

How to remove extra space from string just like we use in java 
getText.trim() in Protractor

Thanks,
Sujata

Rakesh Yeluri | 17 Feb 13:22 2015
Picon

Date format

Hi All,

I have scope property which have below format in my controller,

$scope.event = {
                            name : 'xyz',
                            city : 'Florida',
                            sessions: [
                                {
                                  exp: '5',
                                  UpvoteCount : 2,
                                  Date: '10/12/2015'
                                },
                                {
                                    exp: '2',
                                    UpvoteCount: 5,
                                    Date: '1/12/2015'
                                },
                                {
                                    exp: '1',
                                    UpvoteCount: 8,
                                    Date: '15/12/2015'
                                }
                            ]
                        }

and in the view, I'm trying to fetch in the below format,

 <li ng-repeat="x in event.sessions">
            {{ x.Date | date:'MM-dd-yyyy' }}
 </li>


Output I'm getting like below:
  • 10/12/2015
  • 1/12/2015
  • 15/12/2015

  • Can some one address/suggest why the format is not applying to the date.


  • Thanks

  • --
    You received this message because you are subscribed to the Google Groups "AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
    To post to this group, send email to angular <at> googlegroups.com.
    Visit this group at http://groups.google.com/group/angular.
    For more options, visit https://groups.google.com/d/optout.
    Alexis Slawny | 17 Feb 10:53 2015
    Picon

    ES5 vs TS

    Hello ,

     I work in  a big Bank as head of the HTML team in Paris.

     

    We produced 6 month ago an HTML framework based on Angular 1.2 (to support IE8)/bootstrap and some open source component (datatable, higcharts, handsomtable..) for our IT team .

     

    We’re very happy with it and more than 10 projects have already been successfully released with the framework and people here are already angular addict. (Front end developer is actually an official job here from now J).

     

    We recently faced a new debate, because some of our UK  team are asking to use Typescript instead of ES5 to build their tool (our framework is based on ES5).

     

    I’m wondering on your side if you would had any recommendation/advice regarding this topic as it leads to a lot of discussion around  the ES5 vs TS (mostly around performance, productivity, future migration to ES6/ATS..)

    Best, Alexis

    --
    You received this message because you are subscribed to the Google Groups "AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
    To post to this group, send email to angular <at> googlegroups.com.
    Visit this group at http://groups.google.com/group/angular.
    For more options, visit https://groups.google.com/d/optout.
    Navneet Vij | 16 Feb 23:58 2015
    Picon

    BUSINESS ANALYST(Retail industry exp)...........Edison, NJ

     

    Please reply navneet <at> rgtalent.com

    Hi

    I have an urgent requirement with one of my clients, details given below. If you find your self suitable for the position, please send me your latest updated resume along with contact details. Please include your employer details as well.

     

    Job Title

    SENIOR BUSINESS ANALYST

    Project Location

    Edison, NJ

    Duration

    6 months /Contract

     
    Skills Required and Job Description:

    MODE OF INTERVIEW ; TELEPHONIC AND FACE TO FACE

    SKILLS REQUIRED


    Client looking for straight-forward Senior Business Analysts and Project Managers who have outstanding and impeccable oral & written
    communication skills.

    extensive experience conducting JAD sessions, meeting with end-users, performing flow-charting, etc. is required.

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

    ng-animate in magnific popup

    Hi! I have problem with work ngAnimate in magnific popup. ngAnimateis not worked when i append content in popup. Same ng-init return 'undefined'. $scope.$apply() did not help. Does not display even ng-enter css class. Nothing.


    What should I do to make this work? Thx.

    --
    You received this message because you are subscribed to the Google Groups "AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
    To post to this group, send email to angular <at> googlegroups.com.
    Visit this group at http://groups.google.com/group/angular.
    For more options, visit https://groups.google.com/d/optout.
    Sol | 16 Feb 12:48 2015
    Picon

    How to load grid based on drop-down selection?

    i  am trying to link value of selection of drop-down list to a grid using 
    angular js. any ideas how i can link one drop down value t maltiple grids 
    in one page?
    thanks
    
    
    barti | 16 Feb 12:09 2015
    Picon

    How to integrate resource with two different services to query server with params privided by them?

    I'm learning Angular and I don't like my current approach. The current controller uses first `Geolocation` service and when `getLocation()` is resolved, then the `Pagination` service is invoked with the location param. Is it any better solution to provide one service that query server with location? Can I integrate current logic and move or use the `Pagination` service directly through Post factory, and query server with params of given page and location once resolved? I would like to load new data through invoke just one resource method e.g. from scope loadPage() function. How can I refactor this code?

    app.controller('MainCtrl',['$scope','Post','Pagination','Geolocation'
     
    ($scope, Post, Pagination, Geolocation) ->
        $scope
    .posts = []
       
    Geolocation.getLocation().then (location) ->
         
    Pagination.paginate $scope, Post, 10, (postsRes) ->
            $scope
    .posts.push posts for posts in postsRes
         
    , params: {location: location}
    ])


    app
    .factory 'Post', ($resource) ->
      $resource
    '/posts/:id.json', { id: ' <at> id' }


    app
    .service "Geolocation", ['$q', '$window', ($q, $window) ->
     
    <at> getLocation = ->
        deferred
    = $q.defer()
       
    return deferred.resolve <at> loc if <at> loc
       
    if $window.navigator and $window.navigator.geolocation
          $window
    .navigator.geolocation.getCurrentPosition (position) ->
           
    <at> loc = position.coords
            deferred
    .resolve position.coords


        deferred
    .promise
    ]
    app
    .service 'Pagination', ->
     
    <at> paginate = ($scope, <at> resource, <at> maxElemPerPage=10, <at> onNewPage, <at> query={}) ->
       
    <at> page = 1
       
    <at> canLoadNextPage = true
        $scope
    .loadPage = (promise) =>
         
    return promise.resolve() unless <at> canLoadNextPage
         
    <at> load promise


       
    <at> load = (promise) =>
         
    <at> canLoadNextPage = false
          q
    = angular.extend <at> query, page: <at> page
         
    <at> resource.query q, (resources) =>
           
    <at> canLoadNextPage = true if resources.length is <at> maxElemPerPage
           
    <at> page++
           
    <at> onNewPage resources if <at> onNewPage
            promise
    .resolve() if promise


       
    <at> load()
     
    <at>

    --
    You received this message because you are subscribed to the Google Groups "AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
    To post to this group, send email to angular <at> googlegroups.com.
    Visit this group at http://groups.google.com/group/angular.
    For more options, visit https://groups.google.com/d/optout.
    sam | 16 Feb 11:37 2015
    Picon

    Setting up a project with ui router

    Hi all,

    First time posting on this group (in any in fact) so I hope i'm not breaking any rules !

    I'm trying to settup a project (small test project) with angular-ui-router. When I try and load the app I get:

    [$injector:modulerr] Failed to instantiate module ui.router due to:
    [$injector:nomod] Module 'ui.router' is not available! You either misspelled [...]


    I'm using a layout very similar to the angular seed, here's my layout:

    testapp/
    app/
    mainPage/
    mainPage.html
    mainPage.js
    app.js
    index.html

    I put the ui-router in the package.json and it gets downloaded fine.
    Here are my files:

    app.js:

    angular.module('testProject', [
        'testProject.mainPage',
        'ui.router'
    ])
    .config(['$stateProvider', '$urlRouteProvider', function($stateProvider, $urlRouteProvider){
        $urlRouterProvider.otherwise('/mainpage');
     
    }]);

    mainPage.js:

    angular.module('testProject.mainPage', ['ui.router'])

    .config(['$stateProvider', '$urlRouterProvider',
        function ($stateProvider, $urlRouterProvider){

        $stateProvider.state('mainPage',{
            url: '/mainpage',
            templateUrl: 'mainPage/mainPage.html',
            controller: 'mainPageController'
        });

    }])

    .controller('mainPageController', [function(){
       
    }]);

    index.html:

    <body>

            <div ui-view></div>

    <!-- Bootrap and angular included also -->

            <scricp src="../node_modules/angular-ui-router/release/angular-ui-router.js"></script>

            <script src="app.js"></script>
            <script src="mainPage/mainPage.js"></script>

        </body>

    Tell me if you need more context or anything else.

    Thanks
    Sam



    --
    You received this message because you are subscribed to the Google Groups "AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
    To post to this group, send email to angular <at> googlegroups.com.
    Visit this group at http://groups.google.com/group/angular.
    For more options, visit https://groups.google.com/d/optout.
    Michael Costa | 15 Feb 16:33 2015

    Service vs Factory question...

    I've never quite understood the word 'singleton'..... ; My understanding is that  using a "service" over a "factory" provides the benefit of loading data only once per page-refresh and shares it across the application, whereas the factory instantiates a fresh call to the data source every-time there is a $state change , new controller/scope instance, etc?  

    --
    You received this message because you are subscribed to the Google Groups "AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
    To post to this group, send email to angular <at> googlegroups.com.
    Visit this group at http://groups.google.com/group/angular.
    For more options, visit https://groups.google.com/d/optout.
    tomw | 15 Feb 11:51 2015

    Angular.js and Google Pagespeed Insights: render-blocking JavaScript and CSS in above-the-fold content

    Hi, 

    recently I was just testing a new website build with angular using  Google Pagespeed Insights. Taking care of all the image compression, caching and sizing issues beforehand the analysis left me with a score of 87/100 - with the remaining issue to fix:

    Eliminate render-blocking JavaScript and CSS in above-the-fold content


    Now, according to the angular.js docs it is recommended to :
     
    Place the script tag at the bottom of the page. Placing script tags at the end of the page improves app load time because the HTML loading is not blocked by loading of the angular.js script.


    So that's exactly what I did, but still I'm getting these  disastrous results. What am I missing here? 

    See the index.html below, vendor.js contains all the angular modules:

     
    <!DOCTYPE html>
    <html lang="en" ng-app="app">
     
    <head>
       
    <base href="/">
       
    <meta charset="utf-8">
       
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
       
    <meta name="viewport" content="width=device-width" initial-scale="1.0">
       
    <link rel="stylesheet" href="/css/app.css">
       
    <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
       
    <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet" type="text/css">
       
    <!--if lte IE 7 script(src='http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js')-->
       
    <!--if lte IE 8 script(src='//html5shiv.googlecode.com/svn/trunk/html5.js')-->
     
    </head>
     
    <body>
       
    <div ng-controller="AppCtrl as app" class="app">
         
    <div id="scrollcontainer" class="app-scroll-container">
           
    <div ng-include="'/partials/menu.html'"></div>
           
    <div ui-view></div>
           
    <div ng-include="'/partials/footer.html'"></div>
         
    </div>
       
    </div>
       
    <script src="/js/vendor.js"></script>
       
    <script src="/js/partials.js"></script>
       
    <script src="/js/app.js"></script>
     
    </body>
    </html>

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

    Gmane