Raymond the Developer

1

votes
1

answer
202

views

How to get shipping class name not slug woocommerce

global $product; $shippingClass = $product->get_shipping_class(); this returns the slug but I need the name how do I do this?
1

votes
1

answer
887

views

Wordpress htaccess redirect top level domain to directory

I would like to redirect my Dutch website.nl to website.com/nl/ But can't seem to find the right code to do this in htaccess. Can someone help me with this?
1

votes
1

answer
101

views

Wrong Standard Deviation result in PHP

I have a problem with calculating the standard deviation in php. But it's generating the wrong result. e.g. I am getting as result for (4+4+4+4+4+4) = 1.40 instead of 0. Please help. function std_dev ($attr, $test1,$test2,$test3,$test4,$test5,$test6) { //$items = array($test1->$attr,$test2->$attr,$...
Raymond the Developer
1

votes
1

answer
30

views

How to add NG-class with condition and an object property

I am trying to make this code work. I want the result to be class='project project.select' ng-class='{'project': $state.current.name == 'project.select', $state.current.name}'
1

votes
1

answer
126

views

Prerender.io not working when redirecting root path with apache mod rewrite

I am trying to redirect my root path www.example.com to www.example.com/en/ But when I use this the root path for prerender redirects too. So for example when I go to this www.example.com/?_escaped_fragment_= it redirects directly to www.example.com/en/ instead of www.example.com/en/?_escaped_fragme...
1

votes
1

answer
44

views

A component variable that's assigned to an array from a service changes both ways how to prevent this? [duplicate]

This question already has an answer here: Deep copy an array in Angular 2 + TypeScript 10 answers When I create a variable inside a component and assign it to an array from a service. And change the array from the component it also changes the array from the service. How do I prevent this. export c...
Raymond the Developer
1

votes
1

answer
38

views

How to show angular data model as HTML?

I have a data-model that needs to be converted or show up as html. Right now it just shows up as text. html {{item.svg}} controller $scope.ornamentFigures = ornamentFigures.ornamentFigures; service MyApp.service('ornamentFigures', function(){ this.ornamentFigures = [ {id:'03', name:'wit', svg:''}, {...
Raymond the Developer
1

votes
1

answer
474

views

Prerender with Angular UI Router not rendering root page dynamic content

I have prerender working and running for all pages except the root(home) page. For example: http://www.example.com/?_escaped_fragment_= doesn't render the dynamic data. All other pages works like http://www.example.com/contact?_escaped_fragment_= It's like angular UI router doesn't know what state...
1

votes
3

answer
176

views

include inside ng repeat

I am trying to ng-include inside a ng-repeat. But nothing happens. If I include it statically with the whole link it works. Also tried ng-src but also not working. index.html sliderCtrl.js MyApp.controller('sliderCtrl', function ($scope) { $scope.slides = [ {image: '01', description: 'Image 00'}, {i...
3

votes
1

answer
318

views

How to redirect multiple dynamic URLS with apache

I am trying to redirect multiple paths some with dynamic path names that can be anything. For example: http://www.aaa.com/ => http://www.bbb.com/nl/ http://www.aaa.com/en/ => http://www.bbb.com/en/ http://www.aaa.com/portfolio/(dynamic-name) => http://www.bbb.com/nl/media http://www.aaa.com/en/por...
2

votes
2

answer
1.6k

views

Getting Invalid Signature error with woocommerce rest api using oauth 1.0a

I am getting an invalid signature error in woocommerce rest api. I am also using the oauth 1.0a script from ddo https://github.com/ddo/oauth-1.0a. I generated the api keys twice. Also removed the version parameter inside de oauth script like requested on the woocommerce rest api documentation http:/...
Raymond the Developer
6

votes
2

answer
9k

views

Get element parent height inside directive in AnguarJS

How do you get and set the parent height from an element from inside a directive? This is what I have now, obviously it's not working. var vAlign = angular.module('vAlign', []) .directive('vAlign', function() { return { restrict : 'AC', link: function(scope, e){ e.parent.height(1200); console.log(e....
2

votes
2

answer
2.2k

views

keyCode for tab is not working

I am using the event keypress in backbone. The keyCode for Enter(13) works fine but the keyCode for tab(9) is not working for some odd reason. Please help me figure this out. Thanks. onEnterSetTitle: function(ev) { if (ev.keyCode === 9) { this.$el.find('.set-title-input input').trigger('blur'); } },
2

votes
1

answer
80

views

Getting errormessage only if using function in MYSQL

I made a function to fetch a column and them render each row as a li. But I am getting 'Errormessage:' as result. I tried it without functon and that works fine. Please help. $nkFetch = function($link){ $table1Query = 'SELECT * FROM table1'; $res = mysqli_query($link, $table1Query); if (!mysqli_quer...
Raymond the Developer
4

votes
1

answer
2.2k

views

Need BrowserAnimationsModule in Angular but gives error in Universal

Hi I am using Angular that uses the BrowserAnimationsModule. But in the universal server side it gives the error 'document is not defined'. Because Universal doesn't support BrowserAnimationsModule I need a way to make the server ignore BrowserAnimationsModule and replace it with NoopAnimationsModul...
4

votes
2

answer
549

views

Possible to get the git branch name in a dockerfile?

Not sure if this is even possible. But what I want is to change this line of code inside the dockerfile RUN $(npm bin)/ng build --prod --env=prod to RUN $(npm bin)/ng build --prod --env=test Or better how do I make something like this work in gitbal-ci.yml file: # Production build build: stage: buil...
3

votes
3

answer
5.6k

views

Input field showing different size in iOS

I have an input field with a background and a fixed width/height. It looks good in all the browsers on my desktop. But for some reason it looks bigger on the iPad and iPhone. I tried several tricks in Css but nothing worked so far. width: 120px !important; background-image:url('../img/header-input.p...
Raymond the Developer
2

votes
0

answer
160

views

ng-animate child element inside ng-repeat

I am trying to animate a child element inside a ng-repeat. This is what I have now. I am using css to animate but if you know a different better method please tell. index.html 01.html (included inside ng-repeat) message sass file .slide{ &.ng-hide{ .slider-message-1{ display: block!important; visibi...
7

votes
2

answer
229

views

Manually add ng animate to element

Is it possible to manually add NG animate to an element? For example I want to add ng-enter and ng-leave when a ng-class is added or removed. But I also need ng-enter-active and ng-leave-active classes that gives me more control over the animation process.
5

votes
1

answer
193

views

ios address bar triggered when angular ui router state changes

I am using Angular UI Router. Whenever I click on a link with ui-sref the address bar from ios mobile browser shows up. For example when I scroll down, the address bar hides and if I click on a link and the page transition finishes the ui address bar shows up instantly. This makes it less user frien...
2

votes
2

answer
368

views

Add a filter dropdown for product tags in woocommerce admin product list

I want to also add a filter tag next to the filter by category in the woocommerce products page. Below image is in ducth but I want to add another dropdown menu if possible.
2

votes
0

answer
956

views

SyntaxError: Unexpected token import in Angular 2 Universal when using 3rd party modules

Hi I am getting a SyntaxError when I run server.ts after ng build for Angular Universal (npm start look at package.json). This only happens if I run server.ts and only if I am using a third party modules like Angularitics2 or AdsenseModule. ng serve works perfectly fine. I think it has something to...
1

votes
5

answer
660

views

How to select an object inside array that has a specific value in JS

How do I select an object inside an array where the object has the the value 'A' for the 'slug' key? for example if I have this: var allItems = [ { 'slug': 'henk', 'company_founded': '2008', 'company_category': 'Clean', 'company_logo': false, 'company_description': '', } { 'id': 'bas', 'company_foun...
3

votes
1

answer
490

views

Force route transition to same route with different param in Angular 2

In angular 1 with UI Router when I go to the same route but different param. Angular will reload the view. But in Angular 2 it doesn't. It just updates the data. But I need the user to feel like the page is transitioning to a different page. What I have already tried is forcing angular 2 to route to...
Raymond the Developer
2

votes
2

answer
466

views

preventDefault not working with tab(9) keyCode

I using a keypress event for enter and tab. But fore some reason the code only runs with enter. By pressing tab it just does the default tab action and ignores the code. Please help. onEnterAddWord: function(ev) { var kc = ev.which || ev.keyCode; if (kc === 13 || kc === 9) { ev.preventDefault(); thi...
4

votes
0

answer
955

views

Exclude folder in Sublime SFTP and skip scanning

I am using yeoman to scaffold an angular project. In this folder there is a folder called node_modules. I excluded the folder in the ignore regexes. But it seems Sublime SFTP still scans through it. What I want to do is exclude the folder even for scanning. It takes like an hour before it's done sca...
Raymond the Developer
3

votes
1

answer
91

views

How to (blur) element in angular except when it's clicked in child elements

How do I use blur, but not activate blur when it's clicked in the child elements? I can't trigger the click event on the li element. {{selected}} {{item}}
2

votes
1

answer
97

views

Change http headers inside an angular controller

Hi I need to change http headers from inside a controller. It works in config by using $httpProvider but thats not what I am looking for. I tried this but it says push of undefined. $http.interceptors.push([function() { return { 'request': function(config) { config.headers = config.headers || {}; //...
3

votes
2

answer
407

views

How to use Angular 2 Universal in Angular 4.0

I am trying to learn how to make Angular 2 Universal happen. But I can't find any good tutorials or documentation. My Angular project is currently made with the Angular CLI 1.0 which is now on Angular 4.0. And have read that Universal is built in. I don't even know where to start. Some of the tutori...
3

votes
2

answer
2.5k

views

How to get Route Params inside Resolve Angular 2

I am trying to get my route params inside a resolve. However it doesn't contain the params but when I use activatedRoute from inside a component it does work. I think it's because the route hasn't changed yet inside the resolve. How do I get this to work? post.resolve.ts @Injectable() export class...
7

votes
3

answer
5.4k

views

Losing data in Vagrant after restart or destory

I am new to Vagrant and have some couple of questions. Sometimes when I restart my computer or destroy my vagrant the whole Mysql database is wiped out. I tried to find some answers about this on stackoverflow but didn't had any luck so far. So my question are: 1) Where does the data get stored? 2)...
Raymond the Developer