This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Метод для проверки валидности формы | |
* | |
* @param {Object} formCtrl контроллер формы | |
*/ | |
function isInvalidForm (formCtrl) { | |
return formCtrl.$invalid || (!isAccountablePerson() && !innerKontragents.KontragentId) | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateNomenklatura (value, list) { | |
list = list || $scope.$eval($attrs.nomenklaturaList); | |
ngModelCtrl.$setValidity('uniqueNomenklatura', !isInvalid(value, list)); | |
return value; | |
} | |
ngModelCtrl.$parsers.unshift(validateNomenklatura); | |
ngModelCtrl.$formatters.unshift(validateNomenklatura); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" name="someField" data-validate-nomenklatura="someModel" /> | |
<!-- Вывод ошибок --> | |
<span class="ng-error" | |
data-ng-show="DocumentForm.someField.$error.showError === 'uniqueNomenklatura'"> | |
Уже есть такая номенклатура | |
</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In React Component | |
import React from 'react'; | |
import FluxComponent from 'flummox/component'; | |
/* Components */ | |
import GiveawaySearch from '../common/GiveawaySearch'; | |
import Footer from '../common/Footer'; | |
import Content from '../common/Content'; | |
import Container from '../common/Container'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Store } from 'flummox'; | |
class MainPageStore extends Store { | |
constructor (flux) { | |
super(); // Don't forget this step | |
const MainPageActionIds = flux.getActionIds('MainPage'); | |
this.register(MainPageActionIds.loadData, this.loadData); | |
this.register(MainPageActionIds.getTop, this.getTop); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { bindActionCreators } from 'redux'; | |
import { Connector } from 'redux/react'; | |
import Header from '../components/Header'; | |
import MainSection from '../components/MainSection'; | |
import * as TodoActions from '../actions/TodoActions'; | |
export default class TodoApp extends Component { | |
render() { | |
return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = [1, 2, 3, 4, 5]; | |
function add (result, item, index) { | |
result[index] = item * 2; | |
return result; | |
} | |
function filter (result, item) { | |
if (item % 3 === 0) { | |
result.push(item); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var path = require('path'); | |
var NyanProgressPlugin = require('nyan-progress-webpack-plugin'); | |
module.exports = { | |
devtool: 'eval', | |
entry: [ | |
'webpack-dev-server/client?http://localhost:8080', | |
'webpack/hot/only-dev-server', | |
'./static/jsx/app.js' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
.text { | |
font-size: 7px; | |
color: green; | |
font-face: 'Monotype Coursiva' | |
} | |
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Signup = React.createClass({ | |
render: function() { | |
return <form onSubmit={this._onSubmit}> | |
<forms.RenderForm form={SignupForm} ref=”signupForm”/> | |
<button>Sign Up</button> | |
</form> | |
}, | |
// … |