code: @SuppressWarnings("unchecked")
  	public static void addJSFAttrbituteToAngularModel(Map<String, Object> model, String key, Object value,
  			boolean cacheable) {
  		Map<String, Object> sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
  		Map<String, Object> cache = (Map<String, Object>) sessionMap.get(JSF_ATTRIBUTES_SESSION_CACHE);
  		if (cache.containsKey(key)) {
  			if (cacheable)
  				if (FacesContext.getCurrentInstance().isPostback()) {
  					Object previousValue = cache.get(key);
  					if (null == value && previousValue == null) {
  						return;
  					}
  					if (null != value && value.equals(previousValue)) {
  						return;
  					}
  				}
  			cache.remove(key);
  		}
  		cache.put(key, value);
  
  		String[] keys = key.split("\\.");
  		Map<String, Object> currentMap = model;
  		for (int i = 0; i < keys.length - 1; i++) {
  			if (!currentMap.containsKey(keys[i])) {
  				currentMap.put(keys[i], new HashMap<String, Object>());
  			}
  			final Object object = currentMap.get(keys[i]);
  			if (!(object instanceof Map)) {
  				// the parent object has already been stored
  				return;
  			}
  			currentMap = (Map<String, Object>) object;
  		}
  		currentMap.put(keys[keys.length - 1], value);
  	}
docs: Builds basically a JSON structure from the JSF model.
  
  @param model
  the model to be built
  @param key
  variable name
  @param value
  variable value
  @param cacheable
  if true, the value is only sent if it's different from the
  value of the same attribute in the previous response