Search Posts

Category: angular

How to transition an angularJS application to angular

I currently have a simple search functionality defined in AngularJS ( but I’m hoping to migrate this feature into an existing Angular application. I created a new Angular application and moved the view into app.component.html <head> <script src=”./script.js”></script> </head> <h1> Search Feature </h1> <body ng-app=”search” ng-cloak> <div id=”content” ng-controller=”MainCtrl”> <input type=’text’ ng-model=’searchText’ placeholder=” Enter Query Here ” /> <ul> <li class=”angular-with-newlines” ng-repeat=”course in courses | filter:searchText”> {{course.course_number}}: {{course.title}} <button ng-click=”course.showDesc=!course.showDesc”>See More</button> <div ng-if=”course.showDesc”> Description: {{course.description}} […]

How to Use Highlighting Filter Through Angular Controller

I’m trying to highlight my search results based on the filter defined by this answer: Based on this post ( it would seem that all I have to do is create a separate filter before the controller, but no search results seem to be highlighted. I’m relatively new to Angular so if this is just a simple syntax issue regarding declaring filters in controller, apologies in advance. Here is my code: Thank you […]

Add and remove child component

I have a pageTab component that has multiple children. Each child component registers themselves with the parents to allow the parent to show and hide them when the relevant tab is clicked. My issue is that I can make the contents of the child show and hide via ng-if but I am unsure how to make the component itself show and hide. Can anyone help? Example of problem: <page-tab title=”Vehicle”><!– Correctly shown, has contents –></page-tab> […]

Convert Json objects to single array

this is what i am looking for markers: marker[] = [ { lat: 18.533989, lng: 73.825592, }, { lat: 18.540474, lng: 73.837510, label: ‘B’, }, { lat: 18.540972, lng: 73.832146, label: ‘C’ } ] } this is what i have tried for (let i = 0; i < res.length; i++) { // Iterate over numeric indexes from 0 to 5, as everyone expects. let newobj = res[i].destinationAddress.location.coordinates; console.log(newobj); for(let j = 0; j < res.length; […]

AngularJS Version 6.* Service method is coming up undefined

So I am simply trying to write a component and service that from one view takes the user input and passes it to an api for validation. The problem is that in my component, it’s saying that the service essentially has no method login and is coming up undefined. However I’ve checked and rechecked following’s documentation very closely but can’t get anything to work. LoginComponent.ts import { Component, OnInit } from ‘@angular/core’; import { […]

Angular Different Nav bars

I currently have a basic site I’m converting to Angular as mine is not fully correct by best practices.Currently on my site I have a Login page each user can have 1 of 4 roles (Member, Human Resources, Ceo, Department head) . In my current setup I have a different Nav bar for the Member , Human Resources Department head and CEO. I would Like to maintain this in Angular. Currently on Login if successful […]

angularjs angular hybrid application very slow

i am just using an angular component library called gridster in my large angularjs application. for that i made my app hybrid, as in future we are planning to upgrade our application to be on completely on angular. i am using 1.4.3 angularjs and 6.0 angular version. after making my application it has become very slow. Any suggestion please. most of the module and directives is angularjs, i have followed standard approach of upgrade provided […]

Use Angular2(ANGULAR) methods in Angular1(ANGULARJS) project [duplicate]

This question already has an answer here: Running Angular and AngularJS frameworks side by side 1 answer Well I am an Angular newbie…Is it possible to call up methods from Angular2 project in Angular1 project. That is.. I have an angular2 project named ‘Two’ & angular1 project named ‘One’. The end goal is I need to make changes to ‘one’ in such a way that the complete functionality of ‘Two’ has been implemented. In Nutshell, […]

Next Page »