frontend

Password confirmation and password are equal but validation is still triggering JOI in React component

巧了我就是萌 提交于 2020-01-06 06:06:36
问题 I creating a register form and the problems accurs while try validating password confirmation. I am using the last version of JOI-Browser. I tried the code below and the validation error was triggered even though password and password confirmation have the same values. password: Joi.string() .min(5) .required(), passwordConfirmation: Joi.ref("password") Here is my state object: password: "12345" passwordConfirmation: "12345" username: "" errors: {…} passwordConfirmation: "\

Navigate when clicking on image doesn't work

本小妞迷上赌 提交于 2020-01-06 05:53:13
问题 I've been trying to be able to change screens by clicking on the Image within the code but it isn't working. I've tried defining Push, navigate and other props but it always says that undefined is not an object and show the prop. import React from 'react'; import { AppRegistry, StyleSheet, View, Image, TouchableOpacity, Button } from "react-native"; import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen' import { StackNavigator,

My CSS doesn't change, why?

ε祈祈猫儿з 提交于 2020-01-06 04:04:06
问题 So after many weeks, I got back to coding and I've got a problem. The project I was working on contains the basic stuff of a PHP site and now I'm trying to re-design my homepage. The problem is, that everytime I delete or change something in the CSS, the design never changes as if it's like frozen or something, and it happens for every page. When I delete the link to the CSS in my HTML, the design goes away. Here's the code: var scrolled=0; $(document).ready(function() { $("#master").click

Custom editText on android

醉酒当歌 提交于 2020-01-05 12:09:45
问题 I'm newbie with android layout, so i need some help. I want create a custom editText, something like this: I'm want to fix that with the best possible way. Someone? Thanks. 回答1: If you want the blue line on the left, you can just set the background on the EditText, such as, <EditText android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:background="@drawable/custom_edittext" android:layout_weight="1" /> Then create another file in your

Yii2 BackOffice with API REST Implementation

廉价感情. 提交于 2020-01-05 10:08:51
问题 I have developed an app in Yii2 that is as a backoffice for a Travel Agency. I have used the basic start template, and used gii (code generator) to create the CRUDS for the models (Hotels, HotelRooms, HotelImages, etc) I also want to create two different front-end applications (one for retail, and the other for other agencies), and I thought to separate it from the backend (maybe an angular.js app) and get the info through REST could be a good approach. So I want to use the API Rest based on

Firing an event when the caret gets within a particular div/span/a tag and also, when the caret leaves the tag

这一生的挚爱 提交于 2020-01-05 07:23:13
问题 The idea is this - There is a contenteditable element with some text in it. Am trying to build out a tagging mechanism (kind of like twitter's people tagging when you type '@'). Whenever a user types '@', it shows up a popover with suggestions and filters when they continue typing. Until here it's easy and I have got it figured out. The problem comes when I need to show the popover if/only if the caret is over the element containing the tag. <div contenteditable=""> <p>Some random text before

Is it faster to swap an img src or show/hide multiple images?

限于喜欢 提交于 2020-01-04 03:53:48
问题 What is the best practice to use when swapping an image on a webpage? Altering the image source or just showing/hiding multiple images on the page? 回答1: you have to choose in order to balance speed, with your two options: Altering the image source this way, the page will load faster because it only gets the visible images but it will take a little longer to show the new image when you change src attribute just showing/hiding multiple images this way, you are loading all the images on page

How to only deploy dist folder to azure web site?

蓝咒 提交于 2020-01-04 02:29:05
问题 I have src files and dist/ folder in my azure website project. project |- src/ |- dist/ The default behavior uploads all the files inside of the project, i.e. both src and dist. website |- src/ |- dist/ I want to keep the website clean, only with dist files in it. website |- dist/ It would be even better if I can map the dist folder to the website. website |- all the files |- in dist folder What should I do? I know I can only publish one specific folder by right-clicking on the folder and

Angular 2 Reactive Forms: Cannot find control with path

三世轮回 提交于 2020-01-03 17:29:10
问题 I try to dynamically add Roles to my User/Roles-application. I have a Formarray where i can show the Roles of the User in the Edit View. And there is a button for adding more Roles to the User. But when i press the button "Add Role", i got this error message: ERROR Error: Cannot find control with path: 'rolesArr -> 1 -> name' In this example, i try to add more than one Role to a User that i want to create. Here is my Code: users-edit.component.html (excerpt) <div formArrayName="rolesArr" >

Speeding up Angular $compile function

隐身守侯 提交于 2020-01-03 17:06:12
问题 I'm manually compiling a template against a new scope: var scope = _.assign($rootScope.$new(true), { foo: 1, bar: 2 }) var element = angular.element('<my-element foo="foo" bar="bar"></my-element>') $compile(element)(scope) element.appendTo(container) After running a basic profile, the slowest part of this code is $compile , which takes ~1ms per compilation. I need to compile ~100 elements at a time, as the user scrolls. There are a lot of optimizations I can apply to speed up compilations